Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Assuming I have a user (on a client) that wishes to SSH to a server that it has never connected to before without any user intervention (don't have to very username/password/server fingerprint)

What are the prerequisites to get this done?

Need is what I think:

  • User will have to be added to the server
  • The Server fingerprint will have to be added known_hosts on the users client home directory
  • The users client ssh key will have to be added to authorisedkeys in the users home directory on the server

Have I missed anything?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You need to create a user on the server for your new user.

The User need to generate his SSH Public Key on his local computer and share it with you. Located in general in /home/user_name/ and the file is id_rsa.pub

On the server, you need to create the ~/.ssh/authorized_keys file in the home directory of the new user. Paste the public key in the authorized_keys file.

When the user will try to connect to the first time, the RSA key will be added to his trusted hosts on his local computer and then he will be able to connect via ssh without password.

I think that's it

share|improve this answer
    
Does it not ask if the user would like to add the host to the trusted hosts? I don't want this, I don't want any user intervention required. –  Cheetah Apr 9 '13 at 14:50
    
If you add the host key to ~/.ssh/known_hosts on the user computer it should connect without any prompt. –  Michel Apr 10 '13 at 12:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.