I am trying to ssh locally into localhost without a password after i enter these two commands but Im still being asked for a password. where did i go wrong?
Code:
# ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
# cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
Code:
ubuntu@oh-squiggly-line:~$ sudo chown -R ubuntu project
ubuntu@oh-squiggly-line:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ubuntu/.ssh/id_rsa): /home/ubuntu/project/.ssh/id_rsa
/home/ubuntu/project/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/ubuntu/project/.ssh/id_rsa.
Your public key has been saved in /home/ubuntu/project/.ssh/id_rsa.pub.
The key fingerprint is:
87:6:43:6c:7e:j7:b:fd:sb:99:99:99:f9:99:99:99 ubuntu@oh-squiggly-line
The key's randomart image is:
+--[ RSA 2048]----+
| |
| o |
| o o |
| . o . |
| . S . |
| o o . o|
| o oB |
| .+=+|
| E=+*O|
+-----------------+
ubuntu@oh-squiggly-line:~$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat: /home/ubuntu/.ssh/id_rsa.pub: No such file or directory
ubuntu@oh-squiggly-line:~$ cat ~/project/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ubuntu@oh-squiggly-line:~$ ssh localhost
Enter passphrase for key '/home/ubuntu/.ssh/id_dsa':
ubuntu@localhost's password:
ubuntu@oh-squiggly-line:~$ ssh localhost
Enter passphrase for key '/home/ubuntu/.ssh/id_dsa':
ubuntu@localhost's password:
Permission denied, please try again.
ubuntu@localhost's password:
ubuntu@oh-squiggly-line:~$