Linux Admin

How to Secure Linux Server: disable root login, enable sudo

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

The following steps will make your Linux server more secure:

1, Edit sshd_config to disable root login.

vi /etc/ssh/sshd_config

make sure you have this line:

PermitRootLogin no

2, Change sshd port number to something other than 22, e.g.,

Port 1234

3, Make sure somebody can do su or sudo:

vi /etc/sudoers

add my name to sudo list:

bobsmith ALL=(ALL) ALL

4, Restart sshd

service sshd restart

Technorati : ,
Del.icio.us : ,

Popularity: 1%

Comments

How to change Linux / Unix SSH Port

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

To make your Linux server safer (to protect against SSH brute-force attacks), you can do the following to change SSH port.

vi /etc/ssh/sshd_config

change port from 22 to 2222

#Port 22
Port 2222

Then restart sshd

/etc/init.d/sshd reload

Use SSH:

ssh -p 2222 myservername

Use SCP:

scp -P 2222 myfile.txt me@myservername:/~/.

Technorati : ,

Popularity: 1%

Comments

How to delete files in a directory with too many files on Linux (-bash: /bin/rm: Argument list too long)

No GoodNeed ImprovementOKGoodExcellent (No Ratings Yet)
Loading ... Loading ...

If you try to delete all files in a directory with too many files, you will get this error:

-bash: /bin/rm: Argument list too long

Now you should delete the directory and recreate it.

rm -rf wp-content/cache
mkdir wp-content/cache
chmod 777 wp-content/cache
chown apache:apache wp-content/cache

Technorati :

Popularity: 1%

Comments

« Previous Next »