SSH Key-Gen
Hello,
I am trying to set up a SSH key between servers so no password is required when I have to "scp" files between the two. This is what I have tried so far but still requires a password: Code: Code:
ssh-keygen -t rsa I should also say that I have checked the authorized_keys file on the destination server to make sure the rsa key is in there and it is. Is there something I might be doing wrong or missing? Thanks |
To setup password-less login, do:
1) ssh-keygen (accept all defaults, do not set a password on the key) 2) ssh-copy-id username@destination.server (this will prompt you for a password for 'username') That's it, once ssh-copy-id completes, your key is stored on the remote server. You can scp/ssh to the server in the future without a password, as long as you are doing so as the user that copied the key over. |
Thank you for the response but I have already done that and am questioning if there would be something preventing this from working. The key is in the authorized_keys file and the user is the same.
I tried turning on debugging for scp and it is trying to pass the key but it looks like it is being rejected almost. But the keys match up on each server. |
Check your /etc/ssh/sshd_config file for the following lines:
Code:
PubkeyAuthentication yes If you still have trouble, you can run `sshd` manually on another port with debugging enabled. Then you will see step-by-step the authentication process and hopefully a meaning error message. |
I checked the file you mentioned and it is set correctly.
The thing that is making this difficult is the source server is not really one that I have luxury of debugging services with. It is a live server and a very vital one at that (phone server). Any other ideas that might lead to a "simple" fix? Appreciate the help. |
Quote:
what you did was copy your local private key, as the authorized_key file on the remote server. That's not going to work. You need to dump your public key `cat id_rsa.pub` into authorized_keys txt file on the remote server. |
I should mention I did copy the pub key not the private key like you mentioned.
The only abnormal thing I have found is that I can only reach the the origin server via local IP. When I try to reach it through it's external IP I can not SSH into it would this have an effect on this? |
Quote:
|
All times are GMT -5. The time now is 01:27 PM. |