Networking two computers under Linux

I also dealt a little with this topic, I went into the administrator's waters and looked for a way to network two machines under (Arch) Linux in the simplest way, in order to easily transfer a bunch of data that I need from time to time, and what I allowed myself was fast backups. This is important because I am often do a little distro hopping. One thing is for sure, I always come back to Arch Linux!

Arch Linux

On Linux, as a rule, as in the whole world of free software, everything can be done in many ways. You google, search, bother a few people on the forums and in the end you find a solution that suits you at a given moment. In fact, it will be in the long run. I say this from experience, because once I manage to configure something, it will be a permanent solution :)

This time I found a solution for networking the two computers in a package with the short name sshfs. Behind this strange abbreviation is a very powerful software that allows you to mount remote directories over a secure shell. It is simply put and roughly translated. Somehow I try to avoid those imported words, so maybe what I'm writing seems strange.

Mounting and unmounting procedure

Temporary mounting

In order to temporarily (temporarily mean until the next restart) mount a remote folder we need to know the account with which we access that folder, then the IP address of the remote computer and that's it. In fact, on a local computer, we need a folder on which to mount the remote folder. In general, the command to achieve all this looks like this:

$ sshfs [[email protected]]host:[dir] mountpoint [options]

And a little more specifically:

$ sshfs [email protected]_address:/remote/folder /local/folder -C -p 9876

* user – remote user account
* ip_address – IP address of remote computer
* -C – option for enabling compression
* -p 9876 – connection port

Unmounting

Unmounting is even easier:

$ fusermount3 -u /local/folder

Permanent mounting

There is also a permanent variant (the one that remains after restarting the computer), which involves editing the fstab file:

[email protected]_address:/remote/folder  /local/folder fuse.sshfs noauto,x-systemd.automount,_netdev,user,idmap=user,follow_symlinks,identityfile=/home/USERNAME/.ssh/id_rsa,allow_other,default_permissions,uid=USER_ID_N,gid=USER_GID_N 0 0

Arch Wiki is very well organized and everything about this procedureis very well explained. The summary is here, and for details you will have to get your hands dirty a bit;)