You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connections to multiple remote users (with separate connection ports) possible.
Passwordless connection if the local user's public ssh key has been added to the remote user's ~/.ssh/authorized_keys
Connection example when setup: ssh connection_A
Connection example without setup: ssh -p 4444 -l usera gateway.example.com
Connection syntax without setup: ssh -p <connection_port_A> -l <remote_user_A> <gateway_server_domain_or_ip>
Example connection setup on the local machine in ~/.ssh/config:
Host connection_A
Hostname <gateway_server_domain_or_ip>
User <remote_user_A>
Port <connection_port_A>
Host connection_B
Hostname <gateway_server_domain_or_ip>
User <remote_user_B>
Port <connection_port_B>
Gateway server
Add a special user (say GatewayUser) to system with shell /usr/sbin/nologin.
Add special user to AllowUsers line in /etc/ssh/sshd_config: AllowUsers GatewayUser.
Add line GatewayPorts yes to /etc/ssh/sshd_config.
For added security, the ssh port could be changed: Port <gateway_ssh_port>.
The ssh server needs to be running for the connection to work: sudo systemctl start sshd.service.
For added safety, setup a special user with a long badname, like RemoteUser1234 and
restrict ssh-login to that user only by adding the line AllowUsers RemoteUser1234 to /etc/ssh/sshd_config.
This user can login to a normal user with: su -l <normal_user>.
To faculitate passwordless access, add the local user's public ssh key to ~/.ssh/authorized_keys
The connection is ever more robust with autossh (install with: apt install autossh).
Below, replace ssh with: