You can't use password in ssh_config
. But you might use port forwarding (if allowed on the jumpbox):
SSHPASS=password sshpass -e ssh -L 2222:remotehost:22 user@jumpbox
and then
ssh -p 2222 localhost
will bring you directly to the remote host. You can put that into your ssh_config
, such as:
Host remote-forwarded Hostname localhost Port 2222
and then connect such as
ssh remote-forwarded
Similar way it will work in nautilus.
Port forwarding prohibited on jumpbox
In this case it will get more complicated. You will need to use proxy command to set up port forwarding directly from the remote host. You config will be longer:
Host remote-forwarded Hostname localhost Port 2222 Host jumpbox Hostname jumpbox-host Host remote Hostname remote-host ProxyCommand ssh -W %h:%p jumpbox LocalForward 2222 localhost:22
Otherwise it should work the same way, first
SSHPASS=password sshpass -e ssh remote
and then directly to the other host:
ssh remote-forwarded