Sshd Configuration: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:




=Changing the Default Port=
=Change the Default Port=


Uncomment and/or update the default "Port" value in <tt>/etc/ssh/sshd_config</tt>:
Uncomment and/or update the default "Port" value in <tt>/etc/ssh/sshd_config</tt>:
Line 15: Line 15:
</pre>
</pre>


==Changing the Default Port on a SELinux System==
==Change the Default Port on a SELinux System==


If SELinux is enable, you have to tell SELinux about this change:
If SELinux is enable, you have to tell SELinux about this change:

Revision as of 00:43, 6 January 2016

Internal

Overview

Change the Default Port

Uncomment and/or update the default "Port" value in /etc/ssh/sshd_config:

#Port 22
Port 12345

Change the Default Port on a SELinux System

If SELinux is enable, you have to tell SELinux about this change:

semanage port -a -t ssh_port_t -p tcp 12345

Update the Firewall Rules

If iptables is enabled, there's a firewall rule that allows ssh access, and it usually mentions the port. You may want to check and change that: Iptables_Command_Line_Tool_Examples#Allow_SSH_Only_From_the_Internal_Network_on_a_Non-Standard_Port

Change the Network Interface to Listen On