Hi all,

I'm having problems trying to ssh to the remote host with the sudo'ed account, the story is as follows:

Using my own account:

1. I create rsa keys (ssh-keygen -t rsa)
2. I copy the id_rsa.pub contents to the remote's machine home/.ssh/authorized_keys
3. I can ssh to it without password

Using sudo'ed account

1. I login using my account
2. I sudo to the maintenance account (eg, spprt01, which is a no-login account)
3. I then create rsa keypair
4. I then copy the /home/spprt01/.ssh/id_rsa.pub contents to remote file (remotehost:/home/spprt01/.ssh/authorized_keys)
5. ssh asks for the password of this spprt01 user which doesn't exist (it can only be sudo-ed, it can't login, right)

The question is what is difference between these 2 cases. Thanks very much, all input appreciated.

ssh -v output for the 1 case:

Code:
debug1: Host 'p08' is known and matches the RSA host key.
debug1: Found key in /home/myuser/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myuser/.ssh/identity
debug1: Offering public key: /home/myuser/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8

ssh -v output for the 2 case:

Code:
debug1: Host 'p08' is known and matches the RSA host key.
debug1: Found key in /home/spprt01/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/spprt01/.ssh/identity
debug1: Offering public key: /home/spprt01/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/spprt01/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password: