Use below mentioned command to get top memory consuming processes" |
ps aux | head -1;ps aux --no-headers| sort -rn +3 | head |
Use below command to get top cpu consuming processes: |
ps aux | head -1;ps aux --no-headers | sort -rn +2 |more |
More Technical Help
Showing posts with label Server Tweaks. Show all posts
Showing posts with label Server Tweaks. Show all posts
Sunday, May 8, 2011
Track Top memory and CPU consuming process
Labels:
CPU,
Linux Commands,
Linux Tips,
Memory,
Server Tweaks
Sunday, March 6, 2011
How to Change SSH port on cPanel Server
As far as security concern its a good deal to change the SSH port of your server, simply you need to follow the steps:
1) SSH to the server with root login
2) You need to make sure that the port you are going to assgin is opened at firwall (in case of CSF, APF):
4) You need to change the ssh port in sshd_config File
Uncommnet the line and replace the port and save the file
5) Now it needs to restart ssh service
Note : Dont close your current ssh seesion until you confirm that you are able to login to the server wtih new port in another ssh session.
Thast's
1) SSH to the server with root login
2) You need to make sure that the port you are going to assgin is opened at firwall (in case of CSF, APF):
CSF :
#pico /etc/csf/csf.conf
search for the line : TCP_IN
add the port
APF:3) Now save the changes .
#pico /etc/apf/apf.conf
search for the line : TCP_IN
add the port
4) You need to change the ssh port in sshd_config File
# pico /etc/ssh/sshd_configsearch for Port 22
Uncommnet the line and replace the port and save the file
5) Now it needs to restart ssh service
#/etc/init.d/sshd restart
Note : Dont close your current ssh seesion until you confirm that you are able to login to the server wtih new port in another ssh session.
Thast's
Labels:
cPanel-HowTo,
Port Change,
Server Tweaks,
SSH Hardening
Saturday, March 5, 2011
How to disable root login on cPanel server
For security purpose you may disable direct root login and create another ssh user with the privileges, simply you need to follow the steps:
Note : Don't close your current session until you confirm that the with the changes you have made, the server is accessible in another ssh session
1) Create a user say : webadmin
2 ) Set password for webadmin
3) In case of cPanel, you need to add this user to 'wheel group'
Now the user has been granted su previlages, you need to disable the root login for that you will need to login to the server at shell (command prompt)
1) Edit the SSHD configuration file ‘sshd_config’:
2) Search the line
Once you are complete with the above changes, save the file and exit. You will have to restart the sshd service for the changes to take effect.
Now, you will have to SSH to your server as user ‘webadmin’ and then su to root as follows:
Thats't
Note : Don't close your current session until you confirm that the with the changes you have made, the server is accessible in another ssh session
1) Create a user say : webadmin
# useradd webadmin
2 ) Set password for webadmin
# passwd webadmin
3) In case of cPanel, you need to add this user to 'wheel group'
WHM >> Security Center >> “Manage Wheel Group Users”
Now the user has been granted su previlages, you need to disable the root login for that you will need to login to the server at shell (command prompt)
1) Edit the SSHD configuration file ‘sshd_config’:
pico /etc/ssh/sshd_config
2) Search the line
PermitRootLogin yes
and change it to
PermitRootLogin no
Once you are complete with the above changes, save the file and exit. You will have to restart the sshd service for the changes to take effect.
# /etc/init.d/sshd restart
Now, you will have to SSH to your server as user ‘webadmin’ and then su to root as follows:
login as: webadmin
webadmin@xx.xx.xx.xx’s password: <webadmin pass here>
[admin@server ~]$ su -
password: <root password here>
[root@server ~]#
Thats't
Labels:
cPanel-HowTo,
Disable root login,
Server Tweaks,
SSH Hardening,
su user
Subscribe to:
Posts (Atom)