Solved Why can’t I change to port 2222

I really hope that I am missing something here because this one makes no since at all. Why is it that I cannot login my remote vps using any other port number? I can login using port-22, but the minute I change the port number to anything else such as 2222, I can only login using the the provider Control Panel, but I can no longer login using tmux which been working for weeks.

When I change it back to port-22 then all is well again. Why me? This takes the cake. This even happen on the day I first rented and installed the system. It did not work until I went back to port-22. I did not cry at that time, I had to move on.

I tried again last night; this leaves me to believe that the vps provider themselves are blocking all high-ports for use with ssh. I never heard of such a thing. I read where people here use the same provider and they changed there port to 2222 without a problem.

Has KVM technology changed over night because they heard max was coming to town? It’s embarrassing, however I thought I ask here first before putting in another ticket ... I done two tickets already for other things where one I was correct and they fixed it, and the other was a correction that needed to be made on my end.

Code:
/etc/ssh/sshd_config = port 2222
/etc/services =2222
/etc/pf.conf = 2222

But it only works for 22

Why me
 
Did you also tell TMux to use the new port number?

I thought the command was as simple as this:
Code:
(~) ssh user1@xxx.xxx.xxx.xxx:2222
ssh: Could not resolve hostname xxx.xxx.xxx.xxx:2222: hostname nor servname provided, or not known
or this:
Code:
(~) ssh user1@kvmuser.domain1.com:2222
ssh: Could not resolve hostname kvmuser.domain1.com:2222: hostname nor servname provided, or not known

Is there another way?
 
When in doubt use the manualpages, so man ssh. This will show you ssh(1). The right command is ssh -p 2222 <user>@<hostname>.

Another option to make life a bit easier on you is to edit /etc/ssh/ssh_config. If you define a host entry for this specific host you can configure specific defaults such as the port which should be used to connect. Then you only need to specify the hostname on the commandline and SSH will grab the required details from the configuration file.
 
It is easy at the moment when you start reading. If ssh(1) is too much letters at once, "Could not resolve hostname kvmuser.domain1.com:2222" may provide some hint.

Let me read the man page four you - you are looking for the -p option.
 
So it's like ShelLuser just said . ..

Check its manualpage. So run the man scp command and you can read scp(1). This will expain all the commandline options which are available to you.

If you're using Windows as your client then I've become very happy with PuTTY. Next to a fully usable SSH client (which also supports other options such as telnet) the project also provides commandline options for SCP (pscp.exe). That might also be usable to copy files from one VPS onto the other.

Keep in mind that this assumes that sshd is actually running. TMux has nothing to do with any of this.


Depends. If both are in the same network you could consider looking into mounting remote filesystems using either NFS or perhaps even SMB (Samba). This would give you somewhat more direct access to the other VPS but not where you can also start programs. For that to work you'd need console access, and that's usually done by using ssh(1).

You're probably better off using SSH for this.

Instead of ssh I'm fooling with a empty shell, TMUX. I forget too quickly. All the magic is in the ssh man, then comes tmux.

Now it's ON! I'll never miss again, but I'm glad I did this time :D

Thanks guys.
 
Back
Top