Accessing a server via SSH (Secure Shell) is a common practice for managing files and executing commands on remote systems. In this example, we will discuss accessing a Debian 12 server that is behind a firewall and requires a proxy jump to establish the connection.
Prerequisites
- A Debian 12 server running on a remote machine
- The server is behind a firewall and only allows SSH connections via a proxy
- You have the necessary credentials (username, password, or SSH keys) to access the server
- You have the IP address or hostname of the proxy server
- You have the username and password for the proxy server
Installation of SSH/SFTP Client
On your local machine, install an SSH client if you haven't already. For example, on Ubuntu, you can use the following command:
sudo apt-get install openssh-client
Configuring SSH for Proxy Jump
Create or edit the ~/.ssh/config file on your local machine, if it doesn't exist. Add the following configuration for the server and the proxy:
Host server-name
HostName proxy-server-ip-address
User proxy-username
Password proxy-password
ProxyJump user@server-ip-address
IdentitiesOnly yes
IdentityFile ~/.ssh/id_rsa
Replace server-name, proxy-server-ip-address, proxy-username, proxy-password, user, and server-ip-address with the appropriate values.
Accessing the Server
Now, you can connect to the server using the following command:
ssh server-name
After successful authentication, you will be logged in to the Debian 12 server.