[SOLVED] pve-zync another port?

killmasta93

Renowned Member
Aug 13, 2017
973
58
68
31
Hi
I was wondering if it possible to to pve-zync to another port
Example:
I have two server in site A
server a1 server a2

And on site B i have another 2 servers
server b1 server b2

i would need to pve-zync from server b1 to a1 and b2 to a2 but without the use of site to site, Currently i would NAT the port but only let the WAN IP from site B to access SSH to site A

Thank you
 
Hi,

while there's no direct setting, pve-zsync primarily uses SSH, so you should be able to define some SSH config host entries where you can configure the port.
Normally that'd be done per user, so for pve-zsync in the /root/.ssh/config file, and it would look like:

Code:
host a1
    HostName a1.sitea.example.org
    Port 2201

host a2
    HostName a2.sitea.example.org
    Port 2202

host b1
    HostName b1.siteb.example.org
    Port 2211

# ...

Then you would use the configured hosts like a1 in zsync, or ssh in general.

(disclaimer: I did not actively tested that just now, but from the code-principle it should work)
 
Thanks for the reply, so after trying various was still could not get it working, Not sure if i understood correctly,
so i created a test environment to try it out before

so server b1 is 192.168.6.48 and server a2 192.168.6.49

on server b1 i went to the config and added this
Code:
root@pve3:~# cat /root/.ssh/config
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
host a1
    HostName 192.168.6.49
    Port 2201

on server a2 the ssh port is 2201

but i get this error when running from server b1 to server a2

Code:
root@pve3:~#  pve-zsync create --source 100 --dest 192.168.6.49:rpool/data --verbose --maxsnap 7 --name backupsdaily
COMMAND:
    ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.6.49
GET ERROR:
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: ssh: connect to host 192.168.6.49 port 22: Connection refused


Thank you
 
pve-zsync create --source 100 --dest 192.168.6.49:rpool/data --verbose --maxsnap 7 --name backupsdaily
Well, if you do not use the hostname you configured but still the old IP ssh cannot match and apply those settings..

Try:
pve-zsync create --source 100 --dest a1:rpool/data --verbose --maxsnap 7 --name backupsdaily
 
For clarity: if you want to connect from server A to server B, and server B is only listening on port 12345 for SSH you need to add the host entry to .ssh/config (or independent of the user, for the whole system as default in /etc/ssh/ssh_config) on server A and then also use the name you gave the hostname entry.
As Server A needs to know "hey, this host is not using the default port, go for XYZ".
To make the reverse direction work too, Server B needs an entry for Server A.
 
  • Like
Reactions: killmasta93
Thank you so much, that did the trick,
I had to add on hosts

Code:
root@pve3:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.6.48 pve3.casa.local pve3
192.168.6.49 a1

and with editing the .ssh/config

Code:
host a1
    HostName 192.168.6.49
    Port 2201
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!