Modify /etc/ssh/sshd_config to: ClientAliveInterval 60 ClientAliveCountMax 6 According to the above settings, SSHServer will automatically send a signal to the client every 60 seconds, waiting for the client to respond. If the client does not respond, it will record it until the number of records exceeds the value of ClientAliveCountmax (here set to 6 times), and then the connection will be disconnected. Also available: ServerAliveInterval60 remember to execute it one last time: servicesshdreload.
What does ssh-p mean in linux?
Sship address -P
In general, the default port of sshd service is 22, and some ports have been modified to other ports. In this case, you should add the -p option, pay attention to the capitalized p, and then add the port number of ssh after-p.
How to close ssh service under linux?
Chkconfig-level2345SSHD On-levelWhen the system is running at 2345, it is usually only necessary to start (on)sshd service at 35, and use (off) temporary control to start and stop:/etc/rc.d/init.d/SSHD start | stop | restart.
How does Linux modify the remote control port? Tell me the simple steps.
Modify the Linux remote port as follows:
First, access linux remotely.
Secondly. The ssh configuration file is located in the file /etc/ssh/sshd_config.
Thirdly, modifying the port is to realize vi/etc/ssh/sshd_config by editing this file.
4. Find the line #port22, and the default port is 22. You can delete the previous # and replace 22 with another port.
5. For example, change the original line to Port43999, so that after restarting ssh, the port of ssh will be 43999.
6. You can see that the system has been listening on port 43999, which is actually ssh service. So you can complete the modification.
How to add a port number to centosssh?
Step 1: modify the SSH configuration file (note that it is sshd_config instead of ssh_config, with an extra D).
Step 2: If you close SELinux, you can ignore step 2.
Step 3: If you turn off the firewall, you can ignore step 3. It's too dangerous to open a firewall. I suggest opening it.
Step 4: Restart the SSH service and firewall, preferably the server.
Step 5: Try to log in to SSH through port 10086, or access SSH directly from the server.
Step 6: Modify the third-party server security group policy. If there is no third-party server, the above goal has been achieved, and the sixth step can be ignored.