SSH connection refused error

Webmin version 2.202 Usermin version 2.102
Virtualmin version 7.30.2
Operating system Ubuntu Linux 22.04.5

Hello. I want to transfer to a new server. I have installed virtuamin on the new one.

I ran this command on the old one and it created the backup ok.

virtualmin backup-domain --dest /root/backups/ --all-domains --all-features --newformat --all-virtualmin

When I run it I get a connection error.

root@cp:~# scp -r /root/backups root@157.173.@.@:/root/
ssh: connect to host 157.173.@.@ port 22: Connection refused
lost connection
root@cp:~#

When I run it I get a connection error.
Any help??

Am I to assume you used @ here to denote blanked out IP octets?

But, this has nothing to do with Virtualmin. This is either a network, firewall, or ssh server problem on the destination system. We can probably help, but I’m going to update your title to reflect that it has nothing to do with migrating to a new server.

Is the ssh server running on the destination server? (systemctl status ssh)

Have you opened the ssh port on that destination server firewall? Installing Virtualmin would do that, and most hosts will have it open by default, so it’s pretty unlikely to be firewall, but maybe there’s some other thing happening there.

root@cp:~# systemctl status ssh

● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2024-12-21 22:16:19 EET; 1h 45min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 1103 (sshd)
Tasks: 3 (limit: 19056)
Memory: 6.9M
CPU: 57.081s
CGroup: /system.slice/ssh.service
├─ 1103 “sshd: /usr/sbin/sshd -D [listener] 1 of 10-100 startups”
├─80096 “sshd: [accepted]” “” “” “” “”
└─80097 “sshd: [net]” “” “” “” “” “” “” “” “” “”

Dec 22 00:01:32 server.info sshd[80008]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=15.235.185.2
Dec 22 00:01:34 server.info sshd[80008]: Failed password for invalid user guest from 15.235.185.2 port 55226 ssh2
Dec 22 00:01:35 server.info sshd[80008]: Connection closed by invalid user guest 15.235.185.2 port 55226 [preauth]
Dec 22 00:01:53 server.info sshd[80058]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=218.92.0.163 user=root
Dec 22 00:01:55 server.info sshd[80058]: Failed password for root from @@@@@ port 22887 ssh2
Dec 22 00:01:57 server.info sshd[80058]: Failed password for root from @@@@@ port 22887 ssh2
Dec 22 00:02:01 vps-server.info sshd[80058]: Failed password for root from @@@@@ port 22887 ssh2
Dec 22 00:02:02 vps-server.info sshd[80058]: Received disconnect from @@@@@ port 22887:11: [preauth]
Dec 22 00:02:02 vps-server.info sshd[80058]: Disconnected from authenticating user root @@@@@ port 22887 [preauth]
Dec 22 00:02:02 vps-server.info sshd[80058]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=@@@@@ user=root
root@cp:~

Ah, you didn’t give us the earlier failures where you just gave it a bad password. You’ve been blocked by fail2ban for too many auth failures.

Unban your IP and try again with the right user and password.

I did what you said, I also disabled fail2ban until I did the transfer. I read here in your article that the command is scp -r /root/backups root@new-server.com:/root/.

I write to the old server scp -r /root/backups root@ip_new_server:/root/

Where should I write the user and password you said???

I’ve never use scp but it looks like you need to be able to ssh on first using public key and a private key. Vultr docs has info on it.

I read it but I don’t understand what exactly I should do…

Have you created keys to login to the server via ssh?

P.S. Although I just read it should prompt you for a password if you NOT using keys. Your using root so the user is root.

this maybe better

I finally managed to do it, I connected to the new vps without a password. I did the transfer, I have 2 problems. It gave me the error below that you see and it did not transfer 2 subdomains that I have. Why?

Re-creating records in DNS domain ..

[24/Dec/2024:10:37:41 +0200] Failed to transfer file : Failed to IPv6 connect to cp.vps-server.info:10003 : Connection refused …/web-lib-funcs.pl (line 8261)
Error

Failed to transfer file : Failed to IPv6 connect to cp.vps-server.info:10003 : Connection refused …/web-lib-funcs.pl (line 8261)

root@cp:~#

I have another problem. Why is there red color on the new server in my .Trash and I can’t use it?

Invalid,the message I fixed it.

No new problems. Make another topic.

https://forum.virtualmin.com/guidelines

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.