5 best practices for openssh, the secure way

By bo, 12 January, 2010, No Comment

If you have access or if you have unix (root) server in most cases you use ssh to login into the console.

First of all, to avoid that a user is logged forever into the server, SSH can deal with an idle timeout interval. After this interval has passed, the idle user will be automatically logged out.
In /etc/ssh/sshd config file, enter:

# vi /etc/ssh/sshd config

Find the variable ClientAliveInterval and set this to 300 seconds (5 minutes) as follows:

ClientAliveInterval 300
ClientAliveCountMax 0

Save the file and restart ssh. On debin like systems you have to issue:
/etc/init.d/sshd restart

Second, just disable login as root.

To disable root login via SSH, update your sshd_config again with the following line:

PermitRootLogin no

Third, only use the ssh protocol in version 2. ssh protocol version 1 should be avoided and disabled in ssh config.

Please open sshd_config file and make sure the following line exists or add it there:
Protocol 2

Fourth best practice is to limit the number of users that can login to the server over ssh.

To only allow root, john and joe user to login via ssh please add the following to sshd_config file:

AllowUsers root john joe

Fifth, use strong passwords for your login.

Here is a simple but powerfull password generator function. Add this to your ~/.bashrc.


passwdgen() {
local l=$1
[ "$l" == "" ] && l=20
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}

You can pass a length argument to the passwdgen function:

$ passwdgen 15
L0kyeSv2mSGQc31

Cash Advances Leader- Stock Market Education Pay Day Loans Payday Loans

MAMP Pro a strange issue

By bo, 20 December, 2009, No Comment

After upgrading to 1.8.4 MAMP PRO i had a strange issue. Starting Apache to listen on standard port 80 was not possible. The log file say that there was other process that is running on port 80. I have disabled the websharing in the firewall a year ago, so this was not the problem.

$lsof -i:80 was my friend, and really there was a httpd listening on this port. After i have killed this process i was able to start Apache on port 80, trough MAMP PRO. Strange.

Debt Consolidation Rates