Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i run ssh off port 222? 1

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
how do i run ssh off port 222?

I changed sshd put it is still 22
 
Change the port option in you sshd.conf file. If you want all ssh client connections to use 222 change the port in ssh.conf.

Hope that helps.
 
Just to re-itterate:

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 &quot;client&quot; configured to use 222 when it connects then as in Usige's posting add the 222 port setting into the /etc/ssh/ssh_config

Good Luck
Laurie.
 
Hi,

Not to forget to change /etc/services file as well. Change ssh line to use 222.

regards,
feroz
 
To test it, start sshd manually with a -p222 option. sshd -p222.
 
It is still running on port 22....
/etc/rc.d/init.d/sshd restart
 
(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.

Try again,

Good Luck.
Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top