modification and login of SSH port under Linux
first modify the configuration fileVi/etc/ssh/sshd_configFind the #port 221 segment, here is the identity by default using 22 port, add the following line:Port 50000and then save the exit1. Port modificationExecute/etc/init.d/sshd Restartthis way the SSH port will work on 50000 at the same time.
2. Firewall Modificationsnow edit the firewall configuration: Vi/etc/sysconfig/iptablesenable port 50000. Add the following line
| 1 |
-A INPUT -m state --state NEW -m tcp -p tcp --dport 50000 -j ACCEPT |
thenExecute/etc/init.d/iptables Restartnow, use the SSH tool to connect to port 50000 to test for success.
3. Login Testafter the success, you can drop the comment on port 22 of just a few configuration files .
4. A description of the firewall
There are other times when pinging an address: Destination Port unreachable phenomenonThis behavior indicates that the address is present and the ping packet is sent past and successfully returned, that is, 100% receivedBut why is that so? It's a firewall, and it's supposed to shut down the firewall.
| 1 |
/etc/init.d/firewallstop -- /etc/init.d/firewalldisable |
From for notes (Wiz)
Modification and login of SSH port under Linux