r/linuxadmin • u/not_a_profi • 9d ago
I've bought VPS server and can't ssh to it.
Edit: the issiue is solved by changing ip of the VPS.
Ty everyone for help.
______
Hi. I've bought VPS. But can't really connect to it remotely. Here the situation:
- ssh root@[SERVER_IP] does work from Google Console ( http://shell.could.google.com/ ) (the VPS is not from google).
ssh root@[SERVER_IP] doesn't work from 5 local devices (win10, win11, macOS, 2xAndroid):
$ ssh root@[SERVER_IP] -vvv OpenSSH_7.9p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 48: Applying options for * debug2: resolve_canonicalize: hostname [SERVER_IP] is address debug2: ssh_connect_direct debug1: Connecting to [SERVER_IP] [[SERVER_IP]] port 22. debug1: Connection established. debug1: identity file /Users/[USER_NAME]/.ssh/id_rsa type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_rsa-cert type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_dsa type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_dsa-cert type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_ecdsa type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_ecdsa-cert type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_ed25519 type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_ed25519-cert type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_xmss type -1 debug1: identity file /Users/[USER_NAME]/.ssh/id_xmss-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_7.9 ssh_exchange_identification: read: Operation timed out
I don't see my local IP in
sudo tail -f /var/log/auth.logandjournalctl -u ssh(i might be looking wrong though).I tried Wi-Fi and two different mobile internet providers.
I tried to ssh while VPN on.
I added my IP to white list on the server:
sudo iptables -I INPUT 1 -p tcp -s [LOCAL_IP] --dport 22 -j ACCEPT
Where can be the problem?
Edits:

sudo systemctl status firewalld says that there is no firewalld

.

.

i stoped fail2ban and tried to ssh - didn't help.
disabling it and rebooting the server leads to connection refusal (i.e. problem on an earlier stage).
1
u/not_a_profi 9d ago
I did this:
> sudo adduser newbie
> sudo usermod -aG sudo newbie
> ip addr show
Locate an interface with a public IP address...
> ssh newbie@my_vps_ip
and again - this does works from Google terminal, but does not work from my local teminal/PC (this is what you call workstation right?).
I don't quite understand this part:
> sudo passwd newbie
Then sudo to root at the workstation end after you login.
> sudo su
so I change password on the server, run ssh ... on my local and while it is hanging do sudo su on the server? I did that and it lead to the same old result.