How SSH port became 22 (2017)
Contents How SSH port became 22 The story of getting SSH port 22 Changing the SSH port in the server Specifying SSH port number on the command line Configuring SSH access through firewalls Outbound SSH Back-tunneling is a risk Inbound SSH access Enabling SSH access via iptables. How could I get that port number? I had never allocated one, but I knew somebody who had allocated a port. The port number can be configured by changing the Port 22 directive in /etc/ssh/sshd config. The -p <port> option can be used to specify the port number to connect to when using the ssh command on Linux. The SSH port number command line setting overrides any value configured in configuration files. If there are restrictions on outgoing traffic at all, just create a rule that allows TCP port 22 to go out. Configure firewall to forward all connections to port 22 to a particular IP address on the internal network or DMZ. Use different ports on the firewall to access different servers.