Secure Shell (SSH) is a widely used protocol for remotely connecting to a computer system, typically over a network. It provides encrypted communication and authentication to ensure secure access to a remote machine. In this article, we will discuss how to SSH with ProxyJump in Linux.
ProxyJump is a feature in OpenSSH which allows you to connect to a remote machine via an intermediate host or jump host. It can be used to simplify the process of accessing a remote machine that is behind a firewall or NAT.
How to SSH Jump
To use ProxyJump, you need to have SSH access to both the intermediate and remote hosts. Once you have access, you can use the following syntax to establish a connection to the remote host:
ssh -J intermediate_user@intermediate_host remote_user@remote_host -p remote_port
Here’s a breakdown of the command options:
-J intermediate_user@intermediate_hostspecifies the intermediate host and the user account to use for authentication.
remote_user@remote_hostspecifies the remote host and the user account to use for authentication.
-p remote_portspecifies the port number on the remote host to connect to.
Let’s say we want to connect to a remote host with IP address
10.0.1.100 via an intermediate host with IP address
10.0.2.200 and username
user. We can use the following command to establish the connection:
ssh -J firstname.lastname@example.org email@example.com
This command will use the user account
user to connect to the intermediate host with IP address
10.0.2.200. Once authenticated, it will establish a connection to the remote host with IP address
10.0.1.100 using the same user account.
Note that the
ssh command will use the default SSH port 22 unless otherwise specified. If the remote host uses a different SSH port, you can use the
-p option to specify the port number. For example, to connect to a remote host on port
2222, use the following command:
ssh -J firstname.lastname@example.org email@example.com -p 2222
SSH with ProxyJump is a powerful feature in OpenSSH that allows you to establish secure connections to remote hosts via intermediate hosts. With this feature, you can easily connect to a remote machine that is behind a firewall or NAT. Hope this helps. 🙂