Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Unable to SSH

Unable to SSH

Unable to SSH


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@<>

Any how if I do hop by hop its happening, means
1. sshpass -p 'PassWordB' ssh -p 2222 -tt admin@<ip -B>

2. MACHINE-B:~$ ssh admin@
The authenticity of host ' (' 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@'s password:
Permission denied, please try again.
admin@'s password:
Permission denied, please try again.
admin@'s password:

I am trying to ssh to Machine C from shell script.
Please help.

RE: Unable to SSH

Hello Sreekanth,

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}

• 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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close