PDA

View Full Version : why I don't change the port about ssh



beyond911
17th August 2007, 10:25 AM
When I change the port 22 to 2222 but I don't open ssh in client.
My platform is fc7.

beyond911
17th August 2007, 10:27 AM
When I change the port 22 to 2222 but I don't open ssh in client.
My platform is fc7.

I do it as the fallowing passage.


The vast majority of ssh attacks are directed by compromised zombie machines against ssh servers listening on the default port of "22". By changing this port to something else you greatly reduce the risk of an automated break-in. Edit /etc/ssh/sshd_config and change the line which reads "Port 22" to "Port 2222", or any other unused port of your choosing, preferably above 1024. A line preceded by a '#' is the commented out default value.




#Port 22
Port 22222

twn250
17th August 2007, 11:53 AM
Don't forget to restart sshd

su -
service sshd restart

Then you have to open your firewall to the new port 2222

twn250
17th August 2007, 12:26 PM
For a bit more security also change the line

PermitRootLogin

to

PermitRootLogin no

beyond911
17th August 2007, 03:34 PM
Don't forget to restart sshd

su -
service sshd restart

Then you have to open your firewall to the new port 2222

But my firewall is installed by default method now how to open it ? :confused:

twn250
17th August 2007, 11:15 PM
Menu System -> Administration -> Firewall and SELinux
Locate "Other ports" on the bottom of the window.
Press button "Add".

After you have set the new port 2222 do a reboot.

beyond911
18th August 2007, 03:53 AM
Menu System -> Administration -> Firewall and SELinux
Locate "Other ports" on the bottom of the window.
Press button "Add".

After you have set the new port 2222 do a reboot.
Can you tell some methods by command-line?