LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   'Double log-in' with SSH keys? (https://www.linuxquestions.org/questions/linux-newbie-8/double-log-in-with-ssh-keys-4175508433/)

Tachtory 06-18-2014 06:12 PM

'Double log-in' with SSH keys?
 
I recently configured my computers to not allow password login and only allow publickey access.

Prior to this using passwords I was able, on my home network, to:
  • Using computer 1, ssh into computer 2
  • While logged into computer 2, ssh into computer 3

When I try this now, I get

Code:

Permission denied (publickey,keyboard-interactive)
I tried copying the private-key of computer 1 to computer 2's .ssh directory but it didn't seem to make a difference.

evo2 06-18-2014 07:21 PM

Hi,

the private key should only on computer 1, but you need to enable authentication forwarding when you ssh to computer 2. This can be done using the -A option. If this does not work you should check the output logged by sshd on computer 3. On Debian and derived systems this is usually /var/log/auth.log and on RHEL /var/log/secure. You should also run ssh with -vvv for extra verbose output.

Evo2.

Tachtory 06-18-2014 08:18 PM

Quote:

Originally Posted by evo2 (Post 5190250)
the private key should only on computer 1, but you need to enable authentication forwarding when you ssh to computer 2. This can be done using the -A option.

That worked. Thanks!

evo2 06-18-2014 08:32 PM

Hi,
Quote:

Originally Posted by Tachtory (Post 5190279)
That worked. Thanks!

Great.

Assuming that you are doing this because you can't ssh from computer 1 directly to computer 3, you might find the following thread interesting.

http://www.linuxquestions.org/questi...nd-4175506340/

You'll want to add
Code:

ForwardAgent yes
to the section corresponding to your computer 2.

In that post serverA, serverB and serverC map directly to your "computer 1", "computer 2" and "computer 3".

HTH,

Evo2.


All times are GMT -5. The time now is 12:20 PM.