Linux networking, can somebody help me?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Fritz

Well-Known Member
Apr 6, 2015
3,386
1,386
113
70
I'm trying to slog through Linux networking and have met with nothing but frustration. The problem seems to be that ALL instructions I can find via Google are obsolete and do not apply to the version of Linux I am using, Linux Mint 20.1 Cinnamon. I have NEVER been able to get either Linux to Windows or Linux to linux networking to work. I have never been able to find instructions that apply to the CURRENT VERSION. Surely the info I need is out there somewhere.

PS: I'd like to keep it as simple as possible. I do not need security at all but understand some is required.
 

Fritz

Well-Known Member
Apr 6, 2015
3,386
1,386
113
70
The issue is I can't get it to work. Following instructions found on the web always returns errors. Instruction are vague and ambiguous. My last attempt I got as far as setting up an admin user. I read through the steps and could not see for the life of me how it was actually setting up a user. No user name and no password anywhere in the instructions. I followed them anyway and ran into unknown command or something like that. It's far more complicated than it needs to be, especially in my case.
 

cageek

Active Member
Jun 22, 2018
94
105
33
The issue is I can't get it to work. Following instructions found on the web always returns errors. Instruction are vague and ambiguous. My last attempt I got as far as setting up an admin user. I read through the steps and could not see for the life of me how it was actually setting up a user. No user name and no password anywhere in the instructions. I followed them anyway and ran into unknown command or something like that. It's far more complicated than it needs to be, especially in my case.
Yes, a lot of that stuff is obsolete for network manager? With network manager, try,

sudo nmcli conn show

To give the device connections names. My ethernet is called 'Wired'. Maybe something else on yours. Go and do:

sudo nmcli conn show Wired

That should give you a bunch of variables. You can change them on the command line but if it's just one-time do:

sudo nmcli conn edit Wired

to get an interactive session. Various commands 'print', 'edit', 'edit <variable-name>', etc. from there.
 

Fritz

Well-Known Member
Apr 6, 2015
3,386
1,386
113
70
Sorry, I didn't make myself clear. I'm trying to share files between different boxes. Networking itself is fine, just can't move stuff between machines.
 

tinfoil3d

QSFP28
May 11, 2020
877
403
63
Japan
Sorry, thats not clear at all anyway, if you want to move stuff between windows and linux, there's "samba" for that, if you want just two linux boxes, there's nfs or yet easier(but generally slower, due to encryption) way: ssh(sftp/scp).
 

Fritz

Well-Known Member
Apr 6, 2015
3,386
1,386
113
70
To me, networking is when 2 or more computers are connected to each other and date is moving back and forth between them. Is this clear enough? File sharing is another name for it. Connecting to a network share, etc. I know what samba is, I just can't get it to work between 2 Linux or a Linux and a Windows box. What I do have working is Linux to FreeNas.
 

Marsh

Moderator
May 12, 2013
2,645
1,496
113
Is the Window act as server?
Linux client?

Example
sudo apt-get install cifs-utils -y
sudo mount -t cifs //192.168.0.61/e /mnt/win1 -o user=administrator,password=Passw0rd

change IP , drive , username, password
 
  • Like
Reactions: Angus and Fritz

Fritz

Well-Known Member
Apr 6, 2015
3,386
1,386
113
70
Is the Window act as server?
Linux client?

Example
sudo apt-get install cifs-utils -y
sudo mount -t cifs //192.168.0.61/e /mnt/win1 -o user=administrator,password=Passw0rd

change IP , drive , username, password
I would be happy if I could get it to work either way. Just want to get a handle on what it takes to make it work. Also, as I said, don't want the share in the home directory. I want to be able to share folders I already have elsewhere. Thanks.
 

sboesch

Active Member
Aug 3, 2012
467
95
28
Columbus, OH
Thanks, something to work with. I already have the folders and files I want to share and I'd prefer they not be in the home directory. Is this possible? I know I'm thinking windows here but windows makes a lot more sense this this gibberish. Thanks
Yes, edit the smb.conf file with the paths you want.
 
  • Like
Reactions: Fritz

Marsh

Moderator
May 12, 2013
2,645
1,496
113
Linux server , window client

sudo apt install samba -y
/etc/samba/smb.conf
[misc]
comment = Storage mergerfs
path = /misc
browsable =yes
writable = yes
guest ok = yes
read only = no
public = yes
force user = nobody
force group = nogroup
create mask = 0777
directory mask = 0777

I use the server to store my video files serve to Emby server.
permission is wide open to allow Emby to write to the file share.
You could change user and permission , search smb.conf example on the net
 
  • Like
Reactions: sboesch and Fritz

Markess

Well-Known Member
May 19, 2018
1,154
769
113
Northern California
Perhaps late to the party, but I use this tutorial, which is up to date for Ubuntu 20.04. Ubuntu 20.04 is the the underpinnings of Mint 20.1, and since this approach is all terminal based, the commands ought to be the same. I just work through this page by page and seems to work for me. I'm normally a klutz with this stuff, so I like how this tutorial tells me why I'm doing things, and what I should expect to see at each step

Install and Configure Samba | Ubuntu
 
  • Like
Reactions: Fritz and sboesch

Markess

Well-Known Member
May 19, 2018
1,154
769
113
Northern California
I would be happy if I could get it to work either way. Just want to get a handle on what it takes to make it work. Also, as I said, don't want the share in the home directory. I want to be able to share folders I already have elsewhere. Thanks.
As @sboesch says, edit the smb.conf for the path to the folder(s) you want.

In my case, I keep all the shares on a separate disk. I've got multiple shares there, one for each of the "usual" Home/User folders (Documents, Downloads, Pictures, etc.) Here's a couple of the path entries from my smb.conf. My disks are mounted by UUID, hence the long string of alphanumerics :

path = /mnt/28163172-4ff2-4bb3-b32c-dc075a71be60/Share-Documents​
and​
path = /mnt/28163172-4ff2-4bb3-b32c-dc075a71be60/Share-Downloads​

My desktop PC runs Ubuntu Mate 20.04 (bare metal) and Windows 10 (in a VM with GPU passthrough). The shares let me easily pass files between operating systems, and they automount at boot in both OSs
 
  • Like
Reactions: Fritz and sboesch

sboesch

Active Member
Aug 3, 2012
467
95
28
Columbus, OH
sudo apt -y install samba
Create your groups
sudo groupadd share01
sudo groupadd share02


Create and assign permissions to your shares
sudo mkdir /share01
sudo mkdir /share02
sudo chmod 770 /share01
sudo chmod 770 /share02
sudo chgrp share01 /share01
sudo chgrp share02 /share02


Edit your smb.conf
sudo nano /etc/samba/smb.conf

Go to line 25 and add under set charset
unix charset = UTF-8

Go to line 30 and confirm your Workgroup name
workgroup = WORKGROUP

Go to line 40 and the networks your want to allow access use YOUR NETWORK
interfaces = 127.0.0.0/8 10.0.0.0/24

Go to line 101 and comment out map to guest = bad user and add the following
#guest = bad user
security = user


At the end of your file add your shares

[Share01]
# specify shared directory
path = /share01
# allow writing
writable = yes
# not allow guest user (nobody)
guest ok = no
# allow only [share01] group
valid users = @share1
# set permission [777] when file created
force create mode = 777
# set permission [777] when folder created
force directory mode = 777
# inherit permissions from parent folder
inherit permissions = yes

[Share02]
# specify shared directory
path = /share02
# allow writing
writable = yes
# not allow guest user (nobody)
guest ok = no
# allow only [share02] group
valid users = @share2
# set permission [777] when file created
force create mode = 777
# set permission [777] when folder created
force directory mode = 777
# inherit permissions from parent folder
inherit permissions = yes


Save the file:
ctrl+w

Exit the file:
ctrl+x

You now have samba installed and two shares created, Share01 and Share02.

Now you need to add Samba user
sudo adduser steve
sudo smbpasswd -a steve


Add the user to groups:
For Share01
sudo usermod -G share01 steve
For Share02
sudo usermod -G share02 steve

You have created folders, shares, groups, and users. You now have a functioning SAMBA server.
 
Last edited:
  • Like
Reactions: Markess and Fritz