Depending on the ssh version, you might have to do also this:
- Put the public key in .ssh/authorized_keys2
- Change the permissions of .ssh to 700
- Change the permissions of .ssh/authorized_keys2 to 640
Вопрос
I tried to build PVM code. For that a ssh connection without password is required. I searched a lot and I found a tutorial , I implemented the same, but it didn't work.
My work:-
master is jhamb.
slave is naveen.
Firstly I generate ssh keys on master(jhamb), by using command
ssh-keygen -t rsa
Then I copied id_rsa.pub file into slave(naveen) machine, by using command
scp /home/jhamb/.ssh/id_rsa.pub naveen@10.40.54.92:/home/naveen/.ssh/authorized_keys
Then I login into slave from master., by using
ssh naveen@10.40.54.92
But it always asking for password.
Help me to solve this problem, then only I can configure further for PVM.
Looking for your kind response.
Решение
Depending on the ssh version, you might have to do also this:
- Put the public key in .ssh/authorized_keys2
- Change the permissions of .ssh to 700
- Change the permissions of .ssh/authorized_keys2 to 640
Другие советы
Does naveen have the right to read that file? Also try to editing authorized_keys so the key doesn't have the last string in it (the "someone@somwhere" after the key). So instead of having for example this:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABBAABAQC5IA9w8Knc9YFJZHvRiyZHv7XWXjRgCkLMQdj3LG1pDL8N+7g8C3TB7apA8JqmSs+8YyogN5UzIL1mFz4h1kRvmEcJuoSq+s5+X8aVL0V5qXmcN+TDSevELUpkFm/m/d2RuJAC6+1Eih4PbaGQ0tDVjyBWkgQwbmUNstn3YmdIcavm3z9cPVPIdRGzznLmndOxXOkcMFb32ESuc5NMNKNLcKnzbzyHhXS7JoeKGarTlhmmch7icoRivBWZIWBrdITy6KxkZN8ZSEU1jd6F7WQx1qWO0oEMHrEHnGN4wgi1CZuJTMHXzJbfKc1k91ivb8yh/OK6+iydBNFj94yqAwAD myuser@mypc-EasyNote-TE11HC
You should have this:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABBAABAQC5IA9w8Knc9YFJZHvRiyZHv7XWXjRgCkLMQdj3LG1pDL8N+7g8C3TB7apA8JqmSs+8YyogN5UzIL1mFz4h1kRvmEcJuoSq+s5+X8aVL0V5qXmcN+TDSevELUpkFm/m/d2RuJAC6+1Eih4PbaGQ0tDVjyBWkgQwbmUNstn3YmdIcavm3z9cPVPIdRGzznLmndOxXOkcMFb32ESuc5NMNKNLcKnzbzyHhXS7JoeKGarTlhmmch7icoRivBWZIWBrdITy6KxkZN8ZSEU1jd6F7WQx1qWO0oEMHrEHnGN4wgi1CZuJTMHXzJbfKc1k91ivb8yh/OK6+iydBNFj94yqAwAD==
Edit: Just a quick info - after adding "==" to the end of the key you can put the computer name back - the double equals sign ends the key and stuff after it is a note to the key (who's key is it etc..)