How to share files on a Linux network

This one goes to our colleague Claudio, who wants to learn how to configure a Linux network without using Samba. In an unfriendly comment, Claudio requests the creation of a GUI to be able to carry out a job that thousands (if not millions) of people have already done before and will continue to do it ... as much of this work is by console, and he doesn't like it Much prefer to create a GUI to be able to use it easily (at least Windows as he says) his internal network. Let's first go into this a little bit before the solution.

Business mode vs FOSS

Well, let's keep it simple from the beginning ... This is something that is always claimed in FOSS (Free and Open Source Software) projects, the lack of quality at work. I've always heard, but such game it is better to buy it from the company tal because it is better, such a program is BEST than its free version, such a system is BEST than another free. Let's see why this is:

The company tal lives of your software

If I am a company and my job is to sell software, that means I have to sell something extremely good for people to buy it, and therefore I have to pay to my developers to get it, and this is the starting point of this matter, free software and in some cases open source is developed by goodwill. People are not being paid to develop something for the rest. So if you tell me how are you with   work or whatever is better than its free version, well I tell you, probably, but there is a big problem in that:

It is made to make you dependent

This is like a drug, the more proprietary software you use, the less your ability to think and solve things autonomously. Let's just think about this for a second, do you know where you earn more, in sales or in maintenance? Well the answer to this is simple, no matter how expensive a program or system is, the profit in maintenance will always be greater than the profit in sale, because at the time of the problems, it does not matter the amount of money that must be invested to solve it because simply it can not change the infrastructure at that point.

Necessity is the mother of creation

An unfriendly way of requesting a GUI is not reason enough to do it, and at the same time, sorry if it hurts Claudio, but I have much more important things to do and projects to participate in to invest my time in solving your lack of autonomy and your mental passivity. But since you have asked, well we are going to explain to you why the GUIs do not exist yet for something that in Windows it's so simple.

When you share folders in windows you create security holes

Here more than one will tell me I'm wrong and etc etc ... but the truth is that when you use nmap To recognize a windows computer, probably if it is on a "trusted" network, it will be running a service on some port to be able to share files. This is not only dangerous, but it is so little known that many of the successful attacks arise because of sharing access through the network. But why does this arise? Well because the philosophy  Windows teaches you to say SI without knowing exactly what is happening. (Remember the dependency?) A very simple way to solve this would be to take good care of the equipment, but as the philosophy Windows isn't that, this is where the maintenance comes into play, and makes you have to need of someone to do things for you.

It is not necessary

If necessity is the mother of creation, without necessity, then there is nothing. This is something extremely simple to understand, if the people who use it (usually system administrators, or people using servers) do not need it, they will not create it. In very special cases (usually in free software) the creators put themselves a bit on the feet of the less experienced and decide help creating a GUI (Git has a GUI for those who want to try it out), but again, this is for pure goodwill of the creators, since the amount of work part is so big, and the developers so few, that those jobs are relegated to the free time from some kind-hearted developer. (Let's remember that nobody pays you to do it, and you still have family, work and responsibilities)

Bullying will never be the solution

Take this as advice and comment for all those who read it, I remember a lot a video that I once saw of an interview with Obama (someone I consider a great example of a person), where an angry man begins to criticize and insult him and he did not absolutely nothing. He did nothing, not because he couldn't, that is, he was the most powerful man on the planet at the time, but because he knew he shouldn't lower himself to that level. That is not and will not be a solution in this life, entering into an argument will never bring anything good, there are people who may believe that it does, but at least the intimidation and comments of an X will not move me. I only left it as a comment loose before starting the tutorial.

NFS

Network file system is an application-level protocol that provides information centralizedsynchronized in a network, it works both for Linux systems such as Windows and others (this due to being designed to application level). How we talk so centralized, it means that we are facing a Client / Server model solution. We have already touched on this superficially in another moment, but nothing else to emphasize a small detail.

Why is it important to have centralized information?

Someone else will say, «but I have important information on each type of machine I have, my work laptop, my home computer, etc etc ». The problem is the following, if an efficient backup model were followed, one would notice that creating and maintaining backups of many points is complicated, much easier (for all of us who use scripts and others) is to create a single point where the information arrives and from there begin to safeguard the data. In addition to having multiple versions at different points it not only makes it difficult to follow the information, but it also makes the job more complicated.

I'm not inventing gunpowder

For those who for a second believe that I have discovered this by trial and error, because nothing is further from the truth, I just use a little of what Google offers me and let's see what I found in the first search (I will assume that they are in Ubuntu those who use it, and I guess for Fedora the change should be minimal)

Google

Own. Christopher Diaz Riveros

Always follow what it says Official. This is perhaps one of the first steps to follow, and I put it in case anyone thinks that I knew something about NFS before writing this post.

TL; DR

Own. Christopher Diaz Riveros

Too long; don't read. Every time you see this acronym, you can be 100% sure that it is the "lazy" way to solve a problem, many will complain to me about how to know if it is in English, well, now you know so that there can be no option for complaints later  I use the urban dictionary a lot to understand many of these concepts.

Official Documentation (In Spanish !!)

Own. Christopher Diaz Riveros

Some kind-hearted soul took the job of translating for us this simple but complete page with everything necessary to install an NFS server on our network.

We will quickly see the steps to follow. I leave you the link for the curious who cannot use Google for X reasons to get to the same place.

Install the server and client

Now we are going to install by console what is needed in both places to use the shared files. On the server we install nfs-kernel-server and on the client nfs-common

Own. Christopher Diaz Riveros

Own. Christopher Diaz Riveros

Configure the server

NFS works through a configuration file located at /etc/exports. This file tells NFS which files to share and how to call them, in addition to having very good examples of how to use it by default, we will use the comfort to edit it thanks to the always reliable vim (those who are not comfortable with vim can use nano)

Own. Christopher Diaz Riveros

For this simple example I am telling exports that I want to share my folder workspace (The * indicates that I want to share all the content and without leaving space I write the permissions and options that best suit me, in this case rw for writing and reading)

Restart the server

If we have configured well, we need to restart the server (or start it if it is not active), it is not necessary every time there is a change, but I take the opportunity to make it clear, if you do not want to restart everything, a simple exportfs -ra resolve the issue.

Own. Christopher Diaz Riveros

The first line systemctl start nfs-kernel-server activates the server, the second one is just to verify that everything is ok (if it is not green, it is not ok).

Connect to server

Now we are going to connect our other equipment, for that we will use the comfort, and the command mount.

Own. Christopher Diaz Riveros

Here it is worth emphasizing that the IPs are assigned to your liking, I do not know if they will use DHCP or manual, but once they have the IP they can use it, they add : / path / of / your / folder and a place where you can mount the connection, in my case I created a folder called compartido.

Open your browser

Own. Christopher Diaz Riveros

Here they are both in version comfort as in version GUI. And I show you a bit of how I carry out my work at the institute, I always use virtual machines to work the information of the courses, (that's why they will see an OSX installed) and one for each language, so I can have controlled development environments and don't fill my Gentoo with unnecessary programs. Why ubuntu? well I like it more than Fedora and it's faster to create test machines that I can delete quickly as well. As I said  everyone follows their philosophy and leaving everything ready for use without much thought It is something that Ubuntu makes much easier for its users  (plus I got my system administrator certification in Ubuntu (LFCS allows you to take it in the three major system families: Ubuntu (Debian), CentOS (Red Hat) and SUSE (SUSE)), so it was a good way to remember apt-get y apt)

 Final Thoughts

I've already written a lot this time, but as you can see Claudio, it's only 4 steps (I hope you can do the Google one by yourself so as not to count), and guess what… you don't need a GUI for five commands. Sorry if I can not fulfill your desire to make the world GNU / Linux plus Windows, and prevent you from thinking a little and learning to googling stuff. And if you want to have permanent changes in your network and equipment through /etc/fstabWell, you will have to find it yourself.

For everyone else, please excuse me if I have been rude with this post, and although I have written it a bit moody (I must admit that nobody likes to have their work and effort questioned, and even less than called swagger)… I hope this can really help more than one in their connection work. Thank you very much for getting this far despite my clumsiness and mistakes, Greetings 