what is the command to run ssh on port 1337 or alternate port?
4 Answers
sshd with -p PORT:
-p port Specifies the port on which the server listens for connections (default 22). Multiple port options are permitted. Ports specified in the configuration file with the Port option are ignored when a command-line port is specified. Ports specified using the ListenAddress option override commandline ports.
You can edit sshd config(/etc/ssh/sshd_config):
Port 1337
You want the Port
directive in the sshd_config
file, or alternatively sshd -p
.
See man sshd
& man sshd_config
for more information.
You should read man sshd
or man sshd.conf
it is quite clear.
Just change the (possibly commented, in which case you obviously need to uncomment it) "Port 22" line in your ssh server configuration file to "Port 1337".
-
i only have one client that uses port 1337, other use regular port so i would rather just use the command line to connect that port each time Jan 31, 2011 at 18:48
-
-
Do you want to connect to an ssh server running on port 1337, or do you want to run a server on that particular port? You comment seems to indicate the former while the original question seems to indicate the latter.– user68055Jan 31, 2011 at 19:05