XFCE Thunar SFTP Tutorial web server

Linux XFCE Thunar SFTP Tutorial How To Access Web Server

How to access and transfer files to and from a web server with the help of Linux XFCE. The XFCE desktop environment is very popular in the Linux world and I prefer it to anything else because XFCE is simple and everything works.

Today, I will describe the steps needed in order to mount a web server right inside Thunar as if it was a local partition or drive. In order for the connection to work, a few things need to be in place. To get started, I assume that you use a Linux-based web host because the public RSA key needs to be uploaded via cPanel.

Also, I assume that you are on a Linux system, specifically one that runs the XFCE desktop manager. If you use KDE, then your file manager will be Dolphin which should work too but I can not test this.

Before we can access our web server, the RSA key pair needs to be created.

Creating the RSA Key pair

To get started, open the terminal and type: ssh-keygen -t rsa
Terminal output: Generating public/private rsa key pair.
Enter file in which to save the key (/home/yourUserAccount/.ssh/id_rsa):
Press ENTER to use this location.

Password
The key pair which is being created now needs a password. Some tutorials say to leave the password blank but I do not agree. It’s best to us a long sentence which you can type without making an error and even more importantly, which you won’t forget.
Password suggestion (for inspiration): mywalkisfreshy-speed1mit+p0tat0chippseq
Something weird like that should be OK.

Adding the key with ssh-add

Once the above steps have been completed, we need to tell the system that the key exists by adding it with: ssh-add /home/yourUserAccount/.ssh/id_rsa (press ENTER)
Now that password needs to be entered again.

If you need additional info then I recommend reading this article published by my web host:
https://www.siteground.com/kb/generate_ssh_key_in_linux/

Uploading the public key to the web server

cPanel has a special icon for SSH/Shell related tasks and it is there that we an upload the public key.
Just open the public key in a text editor, select everything and then copy/paste it into the field in cPanel. Fo extra security, you can add your IP address which is a good idea.
Once done, press the upload button and you are all set.

Now the server knows which key to use to authenticate your request for a secure file transfer. This shouldn’t have to be spelled out but since even tech support recommended that I just use FTP, I’ll say it anyway: NEVER EVER use FTP to upload files to your web server. Doing so would mean that you send your login name and password unencrypted and out in the open.

Now all that’s left to do is fire up Thunar and type this into the browser bar.

sftp://accountname@webhostingcompany.com:123456/home/account/public_html/ (and press ENTER). Shortly after, the server wants to know the key password and if we enter it correctly, then the file browser will show all the files and directories just like Cyberduck or Filezilla would show.

Unfortunately, I can’t provide any screenshots because this would reveal server paths and the account name. I hope that you understand and more importantly know that it is possible.
Thunar can mount remote web server shares just like FileZilla or CyberDuck can and all transfers are done over SFTP.

Thunar provides a big advantage compared to SSH access which can do that same except that every file needs to be downloaded, edited and then uploaded again. With the server share mounted locally, I can just edit a file with my text editor and save it right away. This is a huge time saver.

WordPress

These days, CSS frameworks are not as dominant as they were a few years ago. Most of my web design work happens on custom configuring WordPress sites. Still, there are many files to edit and the workflow is a dream. Just right-click a file, open it with my favorite text editor and when done, press ctrl+s to save. It couldn’t be better.

Setting up Thunar to connect to your web server via SFTP will probably take some time but it is worth it once it works. I hope that this article is of help. Since your web host most likely differs from mine, it is best to contact your tech support and ask how you can mount your shared hosting account portion locally in your file browser. At first, they’ll tell you that it can’t be done but that is not correct.

If you have questions then please use the comment form below to get in touch. I will do my best to answer asap.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.