Linode Forum Index Linode Forum
Linode Community Forums
 


Can you change how ubuntu references changed ports?

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
thorrx



Joined: 08 Mar 2009
Posts: 7

Posted: Thu Feb 10, 2011 4:03 pm    Post subject: Can you change how ubuntu references changed ports?  

I'm using Ubuntu 10.04 and wanted to know if you could change how the system references ports once they've been changed elsewhere.

One common example is ssh:
Irregardless of whether it is more secure to change the port from 22 to another number in /etc/ssh/sshd_config.

Once this is done, it seems other programs still reference ssh as running under port 22. For example "ufw allow ssh" opens port 22, not the new port.

Any config files that include "port: ssh" don't seem to work unless I manually edit them to the new number.

Is there a method to let the system and all other installed programs, config files, etc. know that a port has been permanently changed and to use the new number instead?

Thanks in advance.
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1400
Location: Earth

Posted: Thu Feb 10, 2011 4:33 pm    Post subject:  

edit /etc/services
Back to top  
mnordhoff



Joined: 03 May 2008
Posts: 451

Posted: Thu Feb 10, 2011 5:36 pm    Post subject:  

I imagine quite a lot of software will always assume SSH is port 22 instead of following /etc/services, though...
Back to top  
thorrx



Joined: 08 Mar 2009
Posts: 7

Posted: Thu Feb 10, 2011 7:51 pm    Post subject:  

Thanks, that seems to have done it.
Back to top  
piglet



Joined: 22 Oct 2006
Posts: 21

Posted: Fri Feb 11, 2011 1:00 am    Post subject:  

mnordhoff wrote: I imagine quite a lot of software will always assume SSH is port 22 instead of following /etc/services, though...

I doubt it. That would mean I would have to include some sort of list of port names and their numeric mapping with my software, instead of just calling getservbyname() and letting a system library do the work for me.
Back to top  
mnordhoff



Joined: 03 May 2008
Posts: 451

Posted: Sat Feb 12, 2011 5:46 pm    Post subject:  

piglet wrote: I doubt it. That would mean I would have to include some sort of list of port names and their numeric mapping with my software, instead of just calling getservbyname() and letting a system library do the work for me.

I was thinking more along the lines of software that uses SSH, not something that would need a general list of ports. OTOH, such software probably just calls out to /usr/bin/ssh itself. Shrug.

Edit: Thinking about it again, SSH client software isn't very relevant to this discussion anyway. Never mind.
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1