AMH panel reboot VPS Unable to login SSH and SFTP client solution

Source: Internet
Author: User
Tags ssh vps iptables port number ssh port

AMH panel, as one of the Linux VPS host panels developed by the people, the current user volume is still relatively large, even since the new version of last year began charging a lot of controversy, but now basically tend to habits. Because the free version of version 4.2 is basically able to meet the general needs of the site users, if the money or need other functional applications can purchase a paid version.

Before the old left also have encountered in the use of AMH panel VPS, if there is a restart VPS or upgrade other applications, you may encounter a login ssh or SFTP when unable to connect, began to think it is accidental coincidence, Last week in captain told the original AMH panel port settings need to be loaded into the configuration file, if our VPS after the installation of the AMH panel to modify the SSH port, did not load the configuration file, there will be a reboot of the VPS caused by the failure to set the port.
Therefore, if we are ready to install the AMH panel environment in the Linux VPS host, we can refer to two ways.

First, modify the SSH port configuration before installing the AMH panel

After we upgrade the VPS system and some basic security measures, we can modify the SSH port before installing the panel, and then install the AMH panel after the setup is OK.

Second, how to set up after installing the AMH panel

Old left was also used to configure the port and some VPS details after the configuration panel is installed without problems. Then we can't set up a new port like the typical VPS environment, then save the port and we need to load it into the configuration file. Specifically as follows:


Modify the file, locate the port, change the default 22 to the port we need, and execute the command.
/etc/init.d/sshd restart
/etc/init.d/ssh restart

There is no problem with the corresponding execution command error, there are errors we will see the error prompt, is not the port and a number of conflicts, need to replace one.
B-Configure Port Save

/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 directly, and we need to save it to the AMH configuration file/etc/amh-iptables.
In this way, we do not restart or modify the configuration file, will not cause the failure to set the port

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.