I want to setup a box so that I can ssh to it from a certain other box and I'm taken straight into the box without any request for a password. I have followed several different tutorials to do this using SSH keys but none seems to have any affect on the standard login process.
Hopefully somebody has been through this process before and can show me where I'm going wrong. I'll show exactly what I've done.
As root in /root directory:
ssh-keygen -t rsa
scp -p ~/.ssh/authorized_keys Box B:.ssh/
On other server:
chmod 600 /root/.ssh
chmod 700 /root/.ssh/authorised_keys
And then I run 'ssh -i <key file> <server>' and it still requests a password.
Any help appreciated.
Help with SSH keys.
Moderator: General Moderators
Although i can't find it right away, i remember that i had written a little shell script that concatenates all public keys in a directory into authorized_keys2 file, and creates a symlink authorized_keys to the file...
http://www.timvw.be/wp-content/code/bash/setupssh.txt
All it expects is that you place your private key files, to connect TO other machines in ~/.ssh/private and your public key files, to connect FROM other machines in ~/.ssh/public.. (In most situations your private folder would be empty, since you're not connecting TO other machines from that host)
http://www.timvw.be/wp-content/code/bash/setupssh.txt
All it expects is that you place your private key files, to connect TO other machines in ~/.ssh/private and your public key files, to connect FROM other machines in ~/.ssh/public.. (In most situations your private folder would be empty, since you're not connecting TO other machines from that host)
-
impulse()
- Forum Regular
- Posts: 748
- Joined: Wed Aug 09, 2006 8:36 am
- Location: Staffordshire, UK
- Contact:
This is what I have tried, but I also tried it again just and I'm still having the problem. I have checked the SSH config file and the directory is set to authorized_keys.Weirdan wrote:you're copying wrong file. You need to add your public key (usually stored in ~/.ssh/id_rsa.pub) to the ~/.ssh/authorized_keys file on the box you want to connect to.
I have 'Box A' which I'm connecting FROM and 'Box B' which I'm connecting TO.
On Box A I have run ssh-keygen and copied the generated files across to /root/.ssh/authorized_keys on Box B and I have then run 'ssh -i id_dsa.pub <user>@<host>' on Box A but Box B is still asking for a password when I connect to it.