Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do i change the sshd default port from 22
#1

to change the sshd default listening port from 22 to say 6666 do as follows:

 



Code:
vi /etc/ssh/sshd_config

edit the line which reads Port 22 so that it now reads your chosen port number (example below)

#       $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
                                                                               
# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.
                                                                               
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
                                                                               
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.
                                                                               
Port 6666




 

save the file and restart sshd

 

now, to connect via ssh to your new listening port do as follows:

 



Code:
ssh www.somedomain.com -p6666




 

 

 

cheers

 

anyweb

Reply
#2
Maybe it's an idea to make a SSHd tips & tricks in general... instead of all these little settings in a separate tips and tricks post?!
Reply
#3
done !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)