Yesterday I changed the default ports on the server from 22 to 1993 then restarted but now I can't connect at all.
I used
ssh -i keyname.pem ubuntu@remotehost
to connect then
sudo vi /etc/ssh/sshd_config
to change the ports. After that I restarted the server using
sudo service ssh restart
Now I can't connect at all, if I try
ssh -i keyname.pem ubuntu@remotehost
then I get this:
ssh: connect to host 12.34.5.678 port 22: Connection refused
if I try this
ssh -i keyname.pem -p 1993 ubuntu@remotehost
then I get this:
ssh: connect to host 12.34.5.678 port 1993: Operation timed out
I've tried
ssh -v user@host and that gives me this:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/macuser/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 12.34.5.678 [12.34.5.678] port 22.
debug1: connect to address 12.34.5.678 port 22: Connection refused
ssh: connect to host 12.34.5.678 port 22: Connection refused
I've also tried to connect using FileZilla and all I get with that is:
Status: Connecting to internal.livesite.com...
Response: fzSftp started
Command: keyfile "/Users/macuser/Desktop/secure_key"
Command: open "ubuntu@ remotehost" 22
Error: Connection refused
Error: Could not connect to server
If I just try to connect, but if I change the port to 1993 I get this:
Status: Connecting to internal.livesite.com:1993...
Response: fzSftp started
Command: keyfile "/Users/macuser/Desktop/secure_key"
Command: open "ubuntu@ remotehost" 1993
Error: Connection timed out
Error: Could not connect to server
I'm desperate to get this sorted as my boss wants to go through everything with me and I can't upload any changes until this is done. I'd be so grateful for any help.
ufw
,iptables
) Is SSH (or something, at least) listening on port 1993? (netstat -nlt
)Connection refused
is the server rejecting the logon attempt. I think you've got the right IP and port - you just need to check whether the server you're connecting to is allowing your IP and/or user account to connect. The server you are connecting to, does your boss have a technical team who can assist?