RHEL/CentOS usability
Submitted by vladimir on Sun, 06/21/2009 - 21:33
RHEL/CentOS is good server OS, but sometimes it's too Enterprise and needs some usability tuning. I wrote instruction for myself and apply it to all stand-alone servers I manage.
Here it is:
Whoami && whereami
# cpu: cat /proc/cpuinfo # disks: df -h sudo /sbin/fdisk -l /usr/sbin/vgdisplay /usr/sbin/lvdisplay sudo /sbin/hdparm -tT /dev/sda # devices: sudo /sbin/lsusb sudo /sbin/lspci # memory vmstat
Creating user
Do not use root account for many reasons.
Login as root:
/usr/sbin/useradd username -G wheel vi /etc/sudoers # uncomment line "# %wheel ALL=(ALL) ALL" # :w! and :q for saving changes and exit # creating password: passwd username # login as user: su - username # ssh: ssh-keygen vi .ssh/authorized_keys2 # adding my public key here chmod 600 .ssh/authorized_hosts2
Logoff & login as user:
# Change root's password (usually OS are being installed by vendor or datacenter admins) sudo passwd root # Change hostname: vi /etc/sysconfig/network
Install updates
sudo yum updateAdding epel repo
Contains a lot of useful tools.
sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm sudo yum update
Installing musthave utils
sudo yum install htop screen
Other tunings
I hate entering full /usr/sbin/path
sudo vi /etc/profile.d/env.sh # Add: # PATH=/sbin:/usr/sbin/:$PATH # export PATH . /etc/profile echo $PATH
I love postfix MTA:
sudo yum -y install postfix sudo /etc/init.d/sendmail stop sudo /etc/init.d/postfix start sudo yum -y remove sendmail
Mail aliases:
sudo vi /etc/aliases # add alias "root: <my@e.mail>" sudo newaliases echo "hello from `hostname`" | mail -s "test" root
Cleaning
Turn off selinux in not needed:
sudo vi /etc/selinux/config
Turn off X even or runlevel 5:
sudo vi /etc/inittab # comment "x:5:respawn:/etc/X11/prefdm -nodaemon" sudo init q
Turn off unused services (rpc, avahi, etc):
sudo ntsysvReboot
to apply all changes and kernel updates
sudo reboot && exit

turning off selinux
add this to grub's kernel line:-
selinux=0
Many thanks for your great tips
Good job! thanks for your tips. I'v submitted a link of this article to www.linuxine.com in order to share it with more people.
turning off selinux
add this to grub's kernel line:-
selinux=0
Post new comment