Saturday, January 30, 2010

KILLING ALL THE PROCESS FOR A PARTICULAR USER

KILLING ALL THE PROCESS FOR A PARTICULAR USER

To kill all processes of a particular user from root
at unix prompt type:

# kill -9 `ps -fu username |awk '{ print $2 }'|grep -v PID`

We can also use the username as an argument and pass it from
command line, if this command is put as a script.

This command will not disconnect nor logout the user though in 
the system. 

REBOOTING BECAUSE OF FORK BOMBS

REBOOTING BECAUSE OF FORK BOMBS


There is nothing more frustrating
for an Administrator who has to
reboot system due to fork bomb

(the number of processes in the
system reaches the maximum limit
when a user, even a superuser,
tries to execute some command, the
system will respond with Vfork
failed)

In Solaris under SPARC, this can be
controlled by specifying a line in
/etc/system

set maxuprc=64

And reboot the system. Now a user
can have maximum of 64 processes
under his ownership. By default
the 'maxuprc' value is
16*maxusers - 5 where
'maxusers' is another tunable
parameter in /etc/system

Caution : You should have a backup
of /etc/system file before you make
the changes. So that you can revert
back to old system file using
boot -a option in case of
inconsistent system file.

LOCK DOWN TELNET OR FTP

LOCK DOWN TELNET OR FTP

When inbound access isn't required into
a system deny users Telnet or FTP access
do the following:

vi /etc/inetd.conf

Comment the line starts with Telnet or
FTP. Save the file and exit.

Stop and start the inetd daemon now by
following commands:

/etc/rc.d/init.d/inet stop

/etc/rc.d/init.d/inet start

(Your flavor may be /etc/init.d)

Now on nobody can telnet or FTP to your
server from outside network.