Automatic sysLogs Report To Email

install packages:

# yum install ssmtp logwatch

Edit /usr/share/logwatch/default.conf/logwatch:

MailTo = androus@gawab.com
Range = Yesterday
Detail = 10
Service = xxx
mailer = /usr/sbin/ssmtp -t

The available  services are on /usr/share/logwatch/scripts/services

to config ssmtp you can check

Mail Forwarder Post

then:

# logwatch

and check your e-mail!

Advertisements

Setting Full Duplex mode Ethernet Interface

You can check what mode is enabled before:

# ethtool eth1

to change:

# nano /etc/sysconfig/network-scripts/ifcfg-eth1
ETHTOOL_OPTS="speed 1000 duplex full autoneg off"

Restart Interface:

# ifdown eth1 && ifup eth1

Confirm:

# tail -30 /var/log/messages
# ethtool eth1

User Management Commands

SAMBA
smbpasswd -x foo (delete samba user)
smbpasswd -a foo (create samba user)

LINUX
useradd -M foo (create user with no home directory)
useradd -c “name” -M foo (create user with real name)
userdel -r foo (delete user’s files and home directory)
userdel foo (delete only user entry)
usermod -a -G group user (add an existent user to a group)
useradd -g group user (add a new user to a group)
useradd -G group1,group2,group3 user (add user to a list of groups)
groupadd name_group (create a group)
id -nG user (show groups for user)
groupdel (delete an existent group)
adduser (verbose command to create users)

DEFAULT FILES:
default user add file on Red Hat (/etc/default/useradd)
default user add file on Debian (/etc/adduser.conf)

Enable USB ports For VirtualBox

For Mandriva 2009.1 – 2010.0 :

# adduser vboxusers foo
# cat /etc/group | grep vboxusers
# mkdir /vbusbf

add to /etc/fstab

none /vbusbf usbfs rw,devgid=501,devmode=664 0 0 #devgid is the output id number for vboxusers
# mount -a

For mandriva 2009.0 :

edit /etc/rc.sysinit

if [ ! -d /proc/bus/usb ]; then
 modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664
else
 mount -n -t usbfs /proc/bus/usb /proc/bus/usb -o devgid=501,devmode=664
fi

note: devgid is the output id number for vboxusers.

Restart