0

I have two remotes servers (Server_01 and Server_02).

My work literally is on Server_02. In order to access to Server_02, I need the first SSH to Server_01 then another SSH to Server_02.

(machine)$ ssh Server_01
(Server_01)$ ssh Server_02
(Server_02)$ ...

I would like to make things easier where I could use SecureCRT or terminal tab on-click to SSH to Server_02.

1 Answers1

0

You are searching for ProxyCommand.

ssh Server_02 -o ProxyCommand='ssh Server_01 -W %h:%p'

or even better add Server_02 to your ~/.ssh/config

HOST Server_02
  user <myUsername>
  ProxyCommand ssh Server_01 -W %h:%p

Then you can simply use ssh Server_02 from your local machine

jeb
  • 78,592
  • 17
  • 171
  • 225
  • I'm in a private network. I actually don't need to use the public key to ssh. I use different passwords to access to both servers. Is there any way to make the passwords configured as well in ssh config file without typing passwords? – Eric Lorant Dec 17 '19 at 12:17
  • @EricLorant No, it's not possible, because nobody wants to allow such weak security. And I can't think of any case where you really want passwords instead of keys, they are always superior (you can store them in a ssh-agent, ...) – jeb Dec 17 '19 at 12:33