Transferring files between two users/subdomains (SSH-> SFTP)

Hi all,

For a number of downstream reasons, I’m trying to transfer a file I have on one subdomain, which is an SSH User, to another domain which is an SFTP User.

My hope is to eventually have this run repeatedly as a Cron job, but for now I’m just trying to get it working once.

I’ve tried rsync and scp in the terminal as such:

After establishing ssh connection to the server where the file is, I’ve tried:

rsync -vzru /home/userA/sub.domain.com/transfertest/ userB@domain.com:/home/userB/domain.com/transfertest/

and

scp /home/userA/sub.domain.com/transfertest/transfertest.csv userB@domain.com:/home/userB/domain.com/transfertest/

With both, I’m prompted to enter the password for userB. When I do this, the terminal hangs and nothing else happens.

Any advice is appreciated, thanks very much!

Are these users on the same hosting account?

1 Like

Yep they are, is there an easier way to work within the two accounts?

thx

If the users are on the same machine and account, they should be part of the same unix-permission group (typically with a name like pg123456789). By changing the group permissions on directories/files, you can allow members of that group to read/modify files in those directories using basic unix commands like cp and mv.

1 Like

If it’s a single file (or a few) that you need to change on the SSH account you could also simply link to it (or them) from the SFTP account and it will be in effect “auto-synced”.

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