How to change SSH Telnet port in Linux

SSH: Short to secure Shell, SSH (developed by SSH Communications Security Company) is a security protocol for remote login. Using the SSH client, users can connect to the server to safer than other methods (e.g., telnet) in a manner to transmit information. The image is to the right of the SSH session, which uses a command line interface, an example of how the appearance of the can. SSH default port 22.

To improve the security of the server, you should change the SSH login port on the server instead of the default port 22. How to change SSH Telnet port in Linux.

1. Edit the sshd_config file

nano /etc/ssh/sshd_config

Search #Port 22 rows, delete the leading # character, then replace it with the port to use, such as 2404. Make sure that no service is running on that port 2404.

2. Restart sshd service

service sshd restart

3. [options] If you are using such as iptables firewall, you need to open port 2404.

service iptables stop

iptables -A INPUT -m state –state NEW -m tcp -p tcp –dport 2404 -j ACCEPT

service iptables save

service iptables start

Guess you like

Origin www.linuxidc.com/Linux/2019-11/161488.htm