Friday, May 6, 2011

How to disable telnet server in linux

This is a small script to disable telnet server on centos linux. it will work on other redhat distros also.

if [ -e /etc/xinetd.d/telnet ]
sed -i 's/disable.*/disable = yes/' /etc/xinetd.d/telnet
service xinetd restart

copy and run this in terminal. Thats it. Have fun.

How to set chattr attribute on a file

The following post explains how to set ch attribute on a file.
root@me [~]# chattr +i /etc/fstab
root@me [~]# lsattr /etc/fstab
----i--A----- /etc/fstab
root@me [~]# chattr -i /etc/fstab

root@me [~]# lsattr /etc/fstab
-------A----- /etc/fstab
root@me [~]#
The letters "acdijsuADST" select the new attributes for the files: append only (a), compressed (c), no dump (d), immutable (i), data journalling (j), secure deletion (s), no tail-merging (t), undeletable (u),no atime updates (A), synchronous directory updates (D), synchronous updates (S), and top of directory hierarchy (T)