SSH allows you to log in to the server and download files directly from other servers.
- Notice: Some hosts may disable the SSH feature for security reasons.
- Notice: SSH should not be used by people unfamiliar with a Unix environment.
Connect to the server via terminal, using OpenSSH #
Just open the terminal (Linux/MacOS only) and type your username and server name. For example:
ssh gebruiker@yourwebsite.com
You will be asked to enter your password. Do this and press enter
- Notice: You will not see the length of the password, which is not a big deal. Type the password and press Enter.
- Remark: the default ssh server port is 22. If your server has a custom port set up, you must specify it when you connect through the ssh terminal. Example:
ssh -p 2222 gebruiker@yourwebsite.com
Where -p stands for port and 2222 is the port number of your server.
Connect to the server with PuTTy #
Download PuTTy here
Enter your host name and port (by default 22 )
Press "Open." You will proceed to the terminal, enter your username and password. Once connected, the steps below are the same as OpenSSH and PuTTy.
Go to the folder where you want to download your files #
When you are connected, you will appear in your home directory. However, you may want to access your public_html directory, you can do that with the CD assignment. Example:
cd /home/username/domains/yourwebsite.com/public_html/
Where user is your username and yourwebsite.com your domain name. You can also open public_html by simply typing
cd domains/yourwebsite.com/public_html/
Via ssh you log in to your home directory, but if you type the full path, you get always access to the appropriate folder.
Download files. #
Now you can download files with the wget- command. Just type:
wget https://www.yourwebsite.com/filename.png
You can also download from an FTP server using wget. To do this, simply type:
wget ftp://username:password@ftp.yourwebsite.com/filename.png
wget offers much more flexibility and features. If you want to know more about it, you can visit find more information here.
Using Rsync to synchronize files #
Warning: Using rsync may result in file deletion. Therefore, check carefully What you do before using rsync.
rsync is a powerful tool for synchronizing files between servers, or simply uploading one from another server. Example of use:
rsync -avt olduser@youroldwebsite.com:/home/olduser/domains/youroldwebsite.com/public_html/logo.png userr@yournewwebsite.com:/home/user/domains/yournewwebsite.com/public_html/
Where:
- olduser is the user from whom you want to download the file logo.png
- youroldwebsite.com is the domain from which you want to download the file logo.png
- logo.png is a file from youroldwebsite.com that you want to transfer to yournewwebsite.com
- user is the user of the new server to which you want to download your file.
- yournewwebsite.com is the domain where you want to download your file.
- public_html is the folder where the logo.png file is downloaded. Don't forget the / symbol at the end.
rsync is a very powerful tool with many functions. If you want to know more about it, you can use read here.