My goal is to be able to ssh into localhost on my remote linux machine (Ubuntu 12.04 LTS x64).
I have a private key that on my local Windows that I use in putty to access that remote machine. On the remote machine, ~/.ssh/authorized_keys
contains the corresponding public key.
In puttygen, I loaded this private key and used "Export OpenSSH key". Puttygen then warns me "Are you sure you want to save this key without a passphrase to protect it?".
The content of that key is then stored in ~/.ssh/id_rsa
in the remote machine.
However, when I try to execute ssh localhost
on the remote machine, I am asked for a password. Just pressing enter yields
me@host:~/.ssh$ ssh localhost
Enter passphrase for key '/home/me/.ssh/id_rsa':
Permission denied (publickey,hostbased).
File / folder permissions are as such:
me@host:~/.ssh$ ls -lsa
total 20
4 drwx------ 2 me sudo 4096 Aug 6 09:43 .
4 drwxr-xr-x 11 me sudo 4096 Aug 6 09:38 ..
4 -rw------- 1 me sudo 381 Feb 1 2014 authorized_keys
4 -rw------- 1 me sudo 1589 Aug 6 09:38 id_rsa
4 -rw-r--r-- 1 me sudo 1106 Aug 6 08:44 known_hosts
What can I do to be able to password-less ssh
into localhost
?
/usr/sbin/sshd -d
3. Try to log on 4. Post the output?/usr/sbin/sshd -d -p 2222
and run the ssh client withssh -p2222 localhost
ssh localhost
is? Aren't you already logged into localhost on the remote machine? I think what you've done may be a security issue too becauseid_rsa
is your private key for logging into the server, but it sounds like you've also saved this key ON the server. Private keysid_rsa
are like real keys, Public keysid_rsa.pub
are like the padlocks they open.~/.ssh/authorized_keys
is like a door with multiple padlocks. You have to unlock one of them to login as that user. ;-)