Introduction
The use of SFTP is preferable to FTP when possible. Please review our documentation about configuring SFTP in your client:
How to configure your SFTP client
Procedure
If you are moving files between two cPanel servers, you can use the following basic steps to transfer a file quickly. SFTP makes use of the SSHD process so you may use the same authentication method and port for SFTP that you would use for SSH. Please keep in mind that SFTP only works for the root user and cPanel users. FTP users that you create in the "FTP Accounts" icon in cPanel cannot use SFTP due to the technical limitations of FTP-only users.
- Log in to the destination server via SSH as the root user.
-
From the destination server, use SFTP to connect to the source server. The following examples show what the SFTP command would look like in few different situations.
Basic Password Auth SFTP with the root user on port 22:
sftp root@hostname.sourceServer.tld
Key Auth SFTP with the root user on port 22
sftp -i ~/.ssh/yourPrivateSSHKeyNameHere root@hostname.sourceServere.tld
Key Auth SFTP with the root user on port 2222
sftp -P 2222 -i ~/.ssh/yourPrivateSSHKeyNameHere root@hostname.sourceServer.tld
Depending on the versions of software on your server, the above -P option may not work. You can use the following instead:
sftp -oPort=2222 -i ~/.ssh/yourPrivateSSHKeyNameHere root@hostname.sourceServer.tld
-
Once you have connected use the help command to learn how to navigate the source and destination server:
help
-
If you know the full path to your desired file on the source server, you can simply use the following command to transfer it to the destination server:
get /full/path/to/your/desired/file.txt
-
Once you have finished the transfer, you can use the exit command to log out of SFTP and return to SSH on the destination server:
exit
Comments
0 comments
Article is closed for comments.