How to network 3 SolydK machines?

Questions about networking.
In the Original Post please also include the output of inxi -FNzxx
genea
Posts: 17
Joined: 08 Oct 2013 14:14

How to network 3 SolydK machines?

Postby genea » 10 Oct 2013 16:39

It's been years since I've tried to network my home computers, relying on usb storage to move files around instead.

I'm now running SolydK on my machines and the stability is great. I'm hoping someone can talk me through setting these things up to talk to each other - all ext4 partitions. I seldom use Windows and don't need any of the files from those partitions anyway.

Thanks

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: How to network 3 SolydK machines?

Postby toothandnail » 10 Oct 2013 21:55

genea wrote:It's been years since I've tried to network my home computers, relying on usb storage to move files around instead.
I've used USB storage of one sort or anther when necessary, but it is a bit of a pain. Not to mention the pain involved in fixing file ownership and permissions if the usb device doesn't have a native Linux file system.
I'm now running SolydK on my machines and the stability is great. I'm hoping someone can talk me through setting these things up to talk to each other - all ext4 partitions. I seldom use Windows and don't need any of the files from those partitions anyway.
For Linux machines, the primary choices would be NFS and SSH. SSH can provide terminal (and even tunnelled X) access as well as file transfer, but NFS is probably easier to set up for simple file transfers. I use both on my systems.

First question would be how are your machines configured? Do they use DHCP, or are they on static IPs? If they're on DHCP, is the DHCP service provided by a router? If it is by router, how good is the local DNS that that router provides (does it give you some way of identifying individual machines, or, maybe, the ability to reserve IPs for individual machines based on their MAC address)?

The reason I ask those questions is to find out how easy it is to identify each machine on your network - things are going to be a bit more complicated if you don't have some easy way of identifying them.

In my network, I have a small home server, which provides both DHCP and DNS, which allows me an easy way to identify each machine, and also allows things like using the server as a print server so any machine on my network can send printing to a single machine.

For NFS, you will need three packages - nfs-server, nfs-common, and rpcbind. For SSH you will need the openssh-server package and the openssh-client (which may already be installed).

Give me a bit more information about your network and we can work out the details for setting things up.

Paul.

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 11 Oct 2013 16:46

Thanks Paul.

I'm using DCHP provided by router which identifies the individual machines. ifconfig gives me the same information. I'd forgotten that I've got a couple of android phones and a printer hooked into the system too but I'm only really interested in the computers.

Install nfs-server, nfs-common, and rpcbind on each of the computers?

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 11 Oct 2013 17:10

I use samba (see the tutorial).
I also had to remember that if I ssh from 1 PC to the next, my router wants .local for the domain.
-Hinto

User avatar
kwisher
Posts: 42
Joined: 30 Mar 2013 17:31

Re: How to network 3 SolydK machines?

Postby kwisher » 12 Oct 2013 17:07

I would recomend using one of your machines as the "server" and using NFS instead of Samba since you are all Linux. The server can be any of your machines but you would most likely want to use the one with the most free hard drive space since it will be the central storage for your network. Here is a good how-to for setting up NFS: http://ubuntuforums.org/showthread.php?t=249889. Even though the how-to is based on Ubuntu, it will still work for Debian.
The instructions suggested Windows XP or better, so I installed Linux :)

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: How to network 3 SolydK machines?

Postby toothandnail » 12 Oct 2013 18:34

genea wrote:Thanks Paul.
You're welcome. Sorry to be slow replying - ended up with an urgent repair job
I'm using DCHP provided by router which identifies the individual machines. ifconfig gives me the same information. I'd forgotten that I've got a couple of android phones and a printer hooked into the system too but I'm only really interested in the computers.
Ok, that's a good start. As a check, can you try pinging one of the machines by name? As Hinto mentions, sometimes you need something like "local" appended to the name so that it resolves to the local machine. Hope not, but you need to check that you can identify one machine by name from one of the others.
Install nfs-server, nfs-common, and rpcbind on each of the computers?
Depends entirely how you want to set up sharing. You can have shares on all the machines (in which case, yes, all three packages need to be installed on each of the machines), or you can set up a shared area on one of them and connect to that from the other machines. That might be a good start - you can always add shares on the other machines later if you find a need for it.

Anyhow, on any machine that is only going to be an NFS client (ie, not going to offer share to others on the networi), you need to install nfs-common and rpcbind. On any machine that will offer shared disk space, add the nfs-server package (though looking at the listing in Synaptic, you might be better with the nfs-kernel-server package).

Once you have the packages installed, you need to generate the shares. For NFS, shares are defined in /etc/exports, which you will need to open with the editor of your choice. Installing the nfs-kernel-server package puts a blank exports file into etc for you to use. You then define the share as below:

Code: Select all

/home/files/data-1/stor	192.168.1.0/255.255.255.0(no_root_squash,rw)
:) That's an example of a simple export, taken from my home server. Left to right, you have the area to be shared (/home/files/data-1/stor, which is a directory on one of the 2TB drives in my server). Next item allows any machines on the 192.168.1.x subnet to access the share (you can restrict access to an individual machine, or a list of machines, using either IP ranges or names). Final item (and note, it does need to start without space after the access control information) sets basic parameters for the share. no_root_squash means that if someone with root access uses the share from another machine, it will retain root access on the share - if that is not used, the root uid is mapped to a very high number. RW specifies that the share is both read and write (there are some instances where you might want to export a share without write permissions). There are a number of other parameters that can be used, but the list above gives you a simple set of options that you can expand later if you need to.

Once you've defined your shares, you will need to restart the nfs server. In SolydKX, that requires this:

Code: Select all

sudo /etc/init.d/nfs-kernel-server restart
That assumes that it is the nfs-kernel-server package that you have installed, of course.

Once the NFS server has restarted, open a terminal on one of the other machines and enter this:

Code: Select all

sudo showmount -e <machine-name>
:) substitute the name of the machine on which you've set up the shares for <machine-name>

That command should return something like this:

Code: Select all

fang@deneb:~$ sudo showmount -e sms
[sudo] password for fang: 
Export list for sms:
/home/files/data-1/stor 192.168.1.0/255.255.255.0
That shows you the available share. You can then mount it by hand, and once you're happy it works, add it to /etc/fstab so that it is mounted automatically if you want it. I tend to use scripts to mount NFS shares since I don't need them to be active all the time, but it depends on your requirements which way you do it.

To mount an nfs share, I use a command like this:

Code: Select all

sudo mount -t nfs sms:/home/files/data-1/stor /mnt/sms -o nfsvers=3
I'm forcing an nfs version 3 mount, even though the software supports version 4, simply because recently version 4 mounts became quite slow. There is a bug open about that, but until its fixed, its faster to force version 3.

:) Probably enough information to start with.. See how you go and feel free to ask any questions if I've not made things clear.

Paul.

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: How to network 3 SolydK machines?

Postby toothandnail » 12 Oct 2013 18:42

hinto wrote:I use samba (see the tutorial).
I also had to remember that if I ssh from 1 PC to the next, my router wants .local for the domain.
-Hinto
Samba has the advantage of already being installed in SolydXK, and may be simpler to use in some instances (don't know about KDE since I'm not a KDE user, but Xfce network support is annoying, since it assumes samba rather than allowing easy access to things like NFS). For me, the biggest disadvantage of Samba is that fact that it does not preserve Linux file permissions and ownership, which can have unfortunate consequences. I still have a few Samba share around, but for any Linux-oriented network, I'd much rather use NFS.

Having to add .local to machine names is interesting. I used to use a Netgear router which had that habbit, but it didn't apply to the Linksys router I was using until recently. Now I run both DHCP and DNS from my server, using dnsmasq, so its become a non-issue, and I can specify just the base machine name.

Paul.

toothandnail
Posts: 94
Joined: 02 Jun 2013 18:45
Location: Oxfordshire, UK

Re: How to network 3 SolydK machines?

Postby toothandnail » 12 Oct 2013 18:47

kwisher wrote:I would recomend using one of your machines as the "server" and using NFS instead of Samba since you are all Linux. The server can be any of your machines but you would most likely want to use the one with the most free hard drive space since it will be the central storage for your network. Here is a good how-to for setting up NFS: http://ubuntuforums.org/showthread.php?t=249889. Even though the how-to is based on Ubuntu, it will still work for Debian.
:) Not a bad tutorial. If I'd read your message earlier, I could have saved quite a bit of typing....

One thing - portmap is deprecated, and rpcbind is used instead. I'm not sure portmap is supported at all by recent nfs implementations.

Paul.

User avatar
kwisher
Posts: 42
Joined: 30 Mar 2013 17:31

Re: How to network 3 SolydK machines?

Postby kwisher » 12 Oct 2013 18:55

toothandnail wrote:
hinto wrote:I use samba (see the tutorial).
I also had to remember that if I ssh from 1 PC to the next, my router wants .local for the domain.
-Hinto
Samba has the advantage of already being installed in SolydXK, and may be simpler to use in some instances (don't know about KDE since I'm not a KDE user, but Xfce network support is annoying, since it assumes samba rather than allowing easy access to things like NFS). For me, the biggest disadvantage of Samba is that fact that it does not preserve Linux file permissions and ownership, which can have unfortunate consequences. I still have a few Samba share around, but for any Linux-oriented network, I'd much rather use NFS.

Having to add .local to machine names is interesting. I used to use a Netgear router which had that habbit, but it didn't apply to the Linksys router I was using until recently. Now I run both DHCP and DNS from my server, using dnsmasq, so its become a non-issue, and I can specify just the base machine name.

Paul.
I believe you are mistaken, Linux file permissions ALWAYS take first priority. You must not have setup Samba correctly if a Samba user account had improper permissions. I always create my users as Linux users on the box first and assign them to the proper groups then add them as Samba users.
The instructions suggested Windows XP or better, so I installed Linux :)

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 13 Oct 2013 19:39

^as we "split hairs" over nfs and samba, nfs is inherently insecure. All you need is to be logged in and the network tokens are reused. That is, say I have a valid login on one PC 1 with userid (the number, not the name), 1001 and there's a different user on PC 2 with a user id of 1001, then the user on PC 1 can do everything with the files created by the user on PC 2.

The real case is that my company has nfs shares hosted by linux login servers. If I mount those shares from my workstation (instead of logging into the login servers), I can 1) toast all the files owned by root, since I have root access on my workstation and a I can modify/create/delete etc any file as root on that mounted nfs share. 2) do the same to anyone else's files on that server, provided I know their user id.

Samba requires you to log in with a valid samba user/password, either managed by a samba server, or Active Directory. And last I checked, using samba linux to linux does preserve file permissions.

-Hinto

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 13 Oct 2013 20:04

Thank you everyone for feedback. I'm hoping to have the time to tackle networking these things tomorrow. I am following the discussion and doing some background research as things come up.

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 14 Oct 2013 10:58

I'm using DCHP provided by router which identifies the individual machines. ifconfig gives me the same information. I'd forgotten that I've got a couple of android phones and a printer hooked into the system too but I'm only really interested in the computers.


Ok, that's a good start. As a check, can you try pinging one of the machines by name? As Hinto mentions, sometimes you need something like "local" appended to the name so that it resolves to the local machine. Hope not, but you need to check that you can identify one machine by name from one of the others.
Lets see, one step at a time. I can ping the other machines but only if I use the IP address. Haven't figured out the syntax for appending local to a name . . .

ie. ping 192.168.1.4 works
ping eeepc does not. I've also tried ping local:eeepc, local eeepc, eeepc:local, etc.

I'd like to be able to pass files back and forth between my main computer and the netbook.
ie. tower: /storage/share <--------> eeepc: /storage/share

Security at this point is probably not a big issue. No one else has physical access. And if they do I've got a whole other set of problems. :)

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 14 Oct 2013 11:20

ping hostname.local
where you replace hostname with the machine name you want.
-H

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 14 Oct 2013 11:29

Thanks Hinto but no luck.
ping tower.local
ping: unknown host tower.local

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 14 Oct 2013 12:58

That would probably be the way you have the router setup (or it's default).
At one time I had changed my router from "supplied by isp" to OpenDNS and OpenDNS didn't know what .local was (obviously).

You'll have to check your router. Basically, it should be set to try your private domain (like local) before sending the request out to Google/OpenDNS. etc.

I have a netgear router and that's the default (provided I use DNS from charter.net).

-Hinto

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 14 Oct 2013 13:12

I called tech support after that last message. I've got a Comtrend ADSL modem/router. The fellow I talked to wasn't able to help but thought it should work. I'll go through the settings and see if anything jumps out at me. If not, I'll phone back and talk to someone else. The local guys are pretty good.

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 14 Oct 2013 13:19

BTW... you can also set up static ip addresses... and if your router still doesn't resolve a name to an ip, just edit /etc/hosts and put the values in there for each of the PCs. You wouldn't need .local there, since you explicitly telling your workstation that say hinto_host maps to 192.xx.xx.xxx
If you get to having to edit /etc/hosts, it's pretty self explanatory on what to do.
But post back if you get stuck.
-Hinto

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 14 Oct 2013 13:53

hmmm, I can ping by name from a command prompt in Win7 but not from linux? Tried two different kernels, the latest 32bit in SolydK and a slightly older 64bit kernel in Manjaro KDE.

I'll look at /etc/hosts. I'm guessing that only works if the IP address doesn't change?

Deleted User 2763

Re: How to network 3 SolydK machines?

Postby Deleted User 2763 » 14 Oct 2013 13:59

If you can ping in Windows and not linux, it's a domain thing. You can either wait for your isp to field the question, or setup static ips on your router and edit /etc/hosts. You can bypass static ips on your router if you want, but you'll have to edit /etc/hosts every time the router decides to give a different ip (which really isn't often). Don't forget Windows has a hosts file, too. If you want to ping from Windows to your linux workstations, you'll need to edit that, too.
Interestingly enough, samba doesn't seem to need the .local domain on it. You can just use the hostname.
-Hinto

genea
Posts: 17
Joined: 08 Oct 2013 14:14

Re: How to network 3 SolydK machines?

Postby genea » 14 Oct 2013 14:16

editing /etc/hosts worked. Don't plan on using windows - it's there only for the odd thing like updating my GPS firmware. Domain thing? Like Workgroups? No idea how I've got that set. Something else to look at. I've got enough now to make a stab at networking anyway.


Return to “Networking”

Who is online

Users browsing this forum: No registered users and 1 guest