Solve the problem of being unable to log in to the SSH and SFTP client after restarting the VPS in the AMH panel environment

888u

Last update at :2024-06-18,Edit by888u

AMH panel, as one of the Linux VPS host panels developed by Chinese people, currently has a relatively large number of users. Even though there has been a lot of controversy since the new version started charging last year, it is basically getting used to it now. Because the free version 4.2 can basically meet the needs of general website building users, if you have money or need other functional applications, you can purchase the paid version.

Snail has also encountered before that in a VPS using the AMH panel, if you restart the VPS or upgrade other applications, you may be unable to connect when logging in to SSH or SFTP. At first, I thought it was a coincidence. Last week After being notified by the Captain, the port settings of the original AMH panel need to be loaded into the configuration file. If our VPS modifies the SSH port after installing the AMH panel and does not load the configuration file, restarting the VPS will cause the set port to become invalid.

So, if we are ready to install the AMH panel environment in the Linux VPS host, we can refer to two methods.

The first method is to modify the SSH port configuration before installing the AMH panel

After we upgrade the VPS system and take some basic security measures, we can modify the SSH port before installing the panel, and finally install the AMH panel after the settings are correct.

Second, how to set up after installing the AMH panel

Snail used to configure ports and deal with some VPS details after the configuration panel was installed without problems. Then we can't set a new port like a general VPS environment and then save the port. We also need to load it into the configuration file. The details are as follows:

A – /etc/ssh/sshd_config

Modify this file, find the Port port, change the default 22 to the port we need, and then execute the command to take effect.

#centos/etc/init.d/sshd restart

#debian or ubuntu/etc/init.d/ssh restart

If there is no error in the corresponding execution command, there will be no problem. If there is an error, we will see an error message. Does the port conflict with a certain number and needs to be replaced?

B – Configuration port saving

/sbin/iptables -I INPUT -p tcp –dport set port number -j ACCEPT;/sbin/iptables-save > /etc/amh-iptables;

/sbin/iptables-restore < /etc/amh-iptables;

It is useless for us to save it directly. We need to save it to the AMH configuration file /etc/amh-iptables.

In this way, no matter we restart or modify the configuration file, the set port will not become invalid.

Recommended site searches: permanent free server address, overseas virtual host, free proxy IP address, website IP address query, ip138 website query, foreign domain name, how to cancel domain name registration, registration-free space and free network, mainland China space, expiration Domain name query,

Solve the problem of being unable to log in to the SSH and SFTP client after restarting the VPS in the AMH panel environment

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码