I was trying to set custom port for SSH on a vm. I set the port and restarted sshd with service restart sshd
while I was logged into the VM via SSH.
Something went wrong and I am unable access the vm by its local ip, 192.168.1.223 via ssh.
The VM is a CentOs 7 guest on CentOS 7 host. Apache is running. I am able to access 192.168.1.223. But SSH is not.
So, my question is 'how do I force set ssh to a custom port on the vm'?
Status:
Active
Comments
At first check if the new port that you are using for SSH now is allowed in FirewallD.
Moreover, now, when using
ssh
command to connect to your SSH server that runs on the custom port, you would need to use-p
param to specify the custom port, like:ssh -p 2222 user@192.168.1.223
If doesn't help - check for error messages returned, while connecting (like connection refused) or/and messages in
/var/log/secure
. You could also enable verbose logging while connecting by adding-v
param tossh
command.Submitted by JamieCameron on Sun, 02/02/2020 - 10:59 Comment #2
On the Cloudmin side, you can set a custom port for SSH at Change Password -> Change Login Used by Cloudmin
JamieCameron: I did but still same error:
No SSH (Last changed at 02/02/2020 11:01:01 PM) Detailed status error ssh: connect to host 192.168.1.223 port 7201: No route to host
Is the new port
7201
opened on firewall(s)?cannot access the vm via ssh. so, no way of knowing if it is open.