On Windows I'm using FileZilla to upload/download files on my WordPress website, via sftp, while using ssh key.
Now Linux is my primary operating system. For the last month FileZilla client was working fine on Ubuntu 16.04, but now it crashes whenever I start it. I search on internet and found that it is happening with a lot of users. Unfortunately the FileZilla support just have one answer if we ask them:
Ubuntu 16.04 is old OS, use 17.10 or Debian latest version.
I don't want to use 17.10. So I am looking for FileZilla client alternative for Linux, which I can use as sftp client with ssh key.
I found gFTP (which is an old program and I'm not sure how much secure is it?), I also found that I can use Ubuntu file manager to connect to my server. Is that a good idea to connect to server while using Nautilus or Caja?
Actually I don't want to put my username / password in dialogue box which appear when I click File > Connect to server, instead I want to use my .ppk
key. How I can add that in Nautilus or Caja?
Using Nautilus
You can use the option
Connect to Server
in Nautilus as it is shown on the next image.The first example -
sftp://victoria-pass/home/tri
- uses predefined host calledvictoria-pass
and mounts thehome/
directory of the remote user calledtri
.To use this approach, you should create user's configuration file for the local ssh client. The file must be called
config
and placed in the directory.ssh/
in user's home:~/.ssh/config
. According to the example the content of the file should be:Change the file permissions:
In addition, now you should be able to connect to each of these hosts by a command as:
The second example -
sftp://[email protected]:1111/home/tri
- shows how to connect to a remote ssh (sftp) server without using predefined~/.ssh/config
file with a custom ssh port.The main cons of this approach is that if the authentication file is not
~/.ssh/id_rsa
you should provide it in advance by the commandssh-add
. For example if the authentication file is calledfile.pem
:I think you should do this every time when you restart the local machine, or you should include the above command in the
~/.profile
file.Usung gFTP
Here are the steps how to setup gFTP to use SSH keys.
In the FTP menu click on Preferences;
Go to SSH tab;
Fill the field SSH Extra Params with this value:
Change
<user name>
with your real username. Or use:In gFTP's main window choice SSH2 as type of the connection;
Enter the target Host name, or IP address;
Setup the SSH Port of the target machine (if it's not the default -
22
);Enter User for the SSH connection;
Enter your SSH key's Passphrase (if there is some);
Hit Enter.
Using SSHFS
You could mount a remote directory (or the entire file system) via the command-line tool
sshfs
. Then you could manipulate it "locally" as you wish. This is my preferable way. Let's assume the mounting directory is~/mount
and you want to mount the remote user's home directory:Or if you have created
~/.ssh/config
file:In addition you could create also
/etc/fstab
entry - references:Convert the PPK Key
Please note if you are previously have used PPK key, which means PuTTY Private Key, you should convert it because, unlike CloneZilla, the above tools can't read this format. For this purposes you should use the tool
puttygen
that is a part of the packageputty-tools
:Now you can convert the key in this way:
Thanks to @steeldriver for this note. Here is the source and few additional references:
According to the security
While all approaches use the same method of connection - SSH - the security that they provide should be equivalent. From Wikipedia: