vi /etc/ssh/sshd_conf (where it says Port 22 change it to 222 " make sure it is not commented out with a #, if it is remove the hash" it listens on port 22 by default otherwise.
Then restart sshd with: service sshd restart<cr>
or
/etc/rc.d/init.d/sshd restart
If you need to have the local ssh "client" configured to use 222 when it connects then as in Usige's posting add the 222 port setting into the /etc/ssh/ssh_config
(The 1538 ports scanned but not shown below are in state: closed)
Port State Service
1/tcp open tcpmux
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop-3
111/tcp open sunrpc
143/tcp open imap2
443/tcp open https
465/tcp open smtps
953/tcp open rndc
993/tcp open imaps
995/tcp open pop3s
3306/tcp open mysql
6666/tcp open irc-serv
Ah! But did you log right out from your server and then back in before you scanned your ports?
Your existing ssh connection would remain open and connected on port 22 ... thats why you were still able to administer the server and change the port stop/start sshd and still work without being thrown off.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.