Thursday, May 20, 2010

Command to find top process utilizing CPU/Memory in Linux

Command to find top 5 process utilizing more memory

$ ps -eo pmem,pid -o comm | sort -k1nr | head -5

Command to find top 5 process utilizing more cpu resource

$ ps -eo pcpu,pid -o comm | sort -k1nr | head -5

Tuesday, April 27, 2010

Ssh access Deny/Allow only to particular users/groups

To deny access only to particular users/groups

Need to added/append the below lines in "/etc/ssh/sshd_config" file to deny access only to user kutty & group nutty

# vi /etc/ssh/sshd_config

DenyUsers kutty
DenyGroups nutty

#### Restart the ssh service ####

# service sshd restart
(or)
# /etc/init.d/sshd restart

________________________________________________________________

To allow access only to particular users/groups

Need to added/append the below lines in "/etc/ssh/sshd_config" file to deny access only to user kutty & group nutty

# vi /etc/ssh/sshd_config

AllowUsers kutty
AllowGroups nutty

#### Restart the ssh service ####

# service sshd restart
(or)
# /etc/init.d/sshd restart

Note:
We can also add more users/groups in the same line.
________________________________________________________________