Unable to SSH
Unable to SSH
(OP)
Hi
Below is my setup.
MACHINE A --------------------> MACHINE B --------------------> MACHINE C
I want to ssh Machine C from Machine A.
I tried this with the below command, but failed.
$ sshpass -p 'PassWordB' ssh -p 2222 -tt admin@<ip - B> sshpass -p 'PassWordC' ssh admin@< 172.16.1.21>
Any how if I do hop by hop its happening, means
1. sshpass -p 'PassWordB' ssh -p 2222 -tt admin@<ip -B>
THIS TAKES ME TO MACHINE B FROM MACHINE A
2. MACHINE-B:~$ ssh admin@172.16.1.21
The authenticity of host '172.16.1.21 (172.16.1.21)' can't be established.
ED25519 key fingerprint is 33:8:aa:ff:kf:ee:22:77:55:44:55:44:cc:77:55:33.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/admin/.ssh/known_hosts).
admin@172.16.1.21's password:
Permission denied, please try again.
admin@172.16.1.21's password:
Permission denied, please try again.
admin@172.16.1.21's password:
Machine-C:~$
I am trying to ssh to Machine C from shell script.
Please help.
-Regards,
Sreekanth
Below is my setup.
MACHINE A --------------------> MACHINE B --------------------> MACHINE C
I want to ssh Machine C from Machine A.
I tried this with the below command, but failed.
$ sshpass -p 'PassWordB' ssh -p 2222 -tt admin@<ip - B> sshpass -p 'PassWordC' ssh admin@< 172.16.1.21>
Any how if I do hop by hop its happening, means
1. sshpass -p 'PassWordB' ssh -p 2222 -tt admin@<ip -B>
THIS TAKES ME TO MACHINE B FROM MACHINE A
2. MACHINE-B:~$ ssh admin@172.16.1.21
The authenticity of host '172.16.1.21 (172.16.1.21)' can't be established.
ED25519 key fingerprint is 33:8:aa:ff:kf:ee:22:77:55:44:55:44:cc:77:55:33.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/admin/.ssh/known_hosts).
admin@172.16.1.21's password:
Permission denied, please try again.
admin@172.16.1.21's password:
Permission denied, please try again.
admin@172.16.1.21's password:
Machine-C:~$
I am trying to ssh to Machine C from shell script.
Please help.
-Regards,
Sreekanth
RE: Unable to SSH
Why not use something like ssh jumphost command like so:
ssh -i {keypath} -o ProxyCommand="ssh -i {keypath} -W %h:%p user@{jumphost}" user@{hiddenhost}
where:
• jumphost is IP of your publicly accessible instance,
• hiddenhost is IP of your host in the private network,
keypath is a path to your private key located on the current machine that you are trying to ssh from
It is more secure and easier to use ssh key rather than password