Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a way of seamless ssh in a way that when user does ssh through shell, it will be disallowed (or normal rules apply) but if a process (non-interactive) tries to ssh with the same user should be allowed without password. May be some keys generated by the root of the server for users coming with some extra inputs.

Please help.

share|improve this question
@Rilindo Hi Rilindo, I can see a similar point raised by you in one communication in 2011. Please share if you know a way for the same. ssh -i, still seem to be asking for password for me. ref link:… – ashji Jan 14 '13 at 5:59

best way to do this is to have a dedicated ssh key for each process that requires access, make sure that no other user has permissions on the private keys.

Each process should have it's own key so that if any key is comprimised you only have to change one processes setup rather than each one that uses the key.

If you don't want ssh prompting for a password you can use

ssh -o "PasswordAuthentication=no" user@host

This will silently fail if no other authenication succeeds (ie public key) and no prompt will be given

share|improve this answer
Can you please elaborate on how we can generate ssh key on process basis? Please note that there is no separate user account here. – ashji Jan 16 '13 at 15:00
Ssh-keygen -C "comment to add to key file" -f /path/to/privatekeyfile -N "" ; this should create a private key in the file given to the -f flag with corresponding pubfile created with an appending .pub. the comment should probably be the process the key is for. The -N is the password for the private key, best to be blank for non-interactive stuff if omitted it will prompt you for it – peteches Jan 17 '13 at 2:05

Your Answer


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.