Learn and Share How To Do Just Anything

How to copy or move files between two cPanel accounts using SSH command on same server

by HowNow » 09 May 2018, 22:11
This tutorial will highlight clearly how to copy (or even move) files and folders between two cPanel accounts on the same server easily using SSH command lines.
ssh command.png
ssh command.png (4.05 KiB) Viewed 2098 times
The SSH command line is the best, fastest and easiest to perform such content move. Especially if you have root access to both cPanel accounts. So, to accomplish this, the following guide is needed:

First of all, if you do not have access to the server, you may need to download them to your computer and upload unto the second account.

But so long you have root access to the server as root, you can simply execute the 'cp' command to copy the files. The 'cp' command is as follows:

Code: Select all

cp -aRf /home/username1/source /home/username2/destination
With this all the content of the folder 'source' owned by user 'username' will be copied to the folder 'destination' in the account belonging to user 'username2'.

Its that easy.

To erform a move, use the 'mv' command for move file.

Have a great day!

by HowNow » 13 May 2018, 19:47
Remember to change file owner after that:

SSH Change of Owner Files/folders
You want to issue the chown (change owner) command, for example:

chown user /home/user

The command above will change just the folder /home/user. If you wanted to change all of the files and folders within a given directory you would use:

chown -R user /home/user

If you wanted to change the user and group at the same time you would use:

chown user:group /home/user

Where '/home/user' is the path to the directory. If you wanted to change one file then you would specify the file at the end of the path. Please be VERY careful doing this.