Sunday, February 17, 2013

SSH login with Putty, without password

Install ssh-server if it's not already installed. In Debian/Ubuntu, this is what we have to do:
# apt-get install ssh openssh-server

I am using authentication between two hosts without the need of a password in 4 easy steps:
    1. Generate the keys using a DSA authentication identity:
    # ssh-keygen -t dsa
    2. Make a new "authorized_keys" file (if not already there) an paste the key generated by puttygen (see login via Putty without a password):
    # vim ~/.ssh/authorized_keys
    3. Assign rw permissions only for the owner
    # chmod 600 ~/.ssh/authorized_keys
    4. Configure Putty to know where the saved private key file (see login via Putty without a password)

If you'd like to secure SSH, more setup is neccessary. Hints: fail2ban (blacklist IPs using iptables), denyhosts (blacklist IPs using /etc/hosts.deny file).

When in trouble configuring Putty to access remote machines, you may find useful this post:

Debian Linux Install OpenSSH SSHD Server
SSH Debian Wiki

Last update: 2013.03.17

No comments: