LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-28-2022, 12:29 PM   #1
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Rep: Reputation: Disabled
Samba how-to Linux - Windows


Can somebody point me to a HOW-TO for using Samba to share a Linux directory with a MSW 10 machine on my LAN? If it matters, the Linux box is wire-connected to the LAN and the MSW box is wirelessly connected.
 
Old 01-28-2022, 12:36 PM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,597

Rep: Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545Reputation: 2545

There's a number of guides on the Samba Wiki.

 
Old 01-28-2022, 01:11 PM   #3
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thanks! That'll keep me busy for a while. :-)
 
Old 01-28-2022, 04:55 PM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by JavaMeister View Post
Can somebody point me to a HOW-TO for using Samba to share a Linux directory with a MSW 10 machine on my LAN? If it matters, the Linux box is wire-connected to the LAN and the MSW box is wirelessly connected.
It's very easy to do this.

1. On the server, create a config file (/etc/samba/smb.conf) with contents like this:
Code:
[global]
        server string = myservername
        server role = standalone server
        max log size = 50
        log file = /var/log/samba/samba.%m
        deadtime = 10
[fileshare]
        comment = My file share
        path = /path/to/shared/directory
        browseable = yes
        writeable = yes
        write list = @smbusers
        valid users = @smbusers
        create mask = 0664
        directory mask = 0775
2. Create a group called 'smbusers'
3. Add users to the smbusers group
4. Check that the shared directory is owned by the smbusers group, and can be written by them (i.e. "chmod 0775 /path/to/shared/directory" and then "chgrp smbusers /path/to/shared/directory")
5. Add local users to the Samba database with 'smbpasswd' (e.g: smbpasswd -a username)
6. Most importantly, don't forget to start the Samba service. This differs by distro. On Slackware, its (as root): "# sh /etc/rc.d/rc.samba start"

If you use the same login names & passwords on the Windows machines, the users will automatically be able to read & write the share. Depending upon your router, you might be able to browse to the share using it's name. Otherwise you can use the IP address in the File Explorer toolbar preceded by a double backslash (eg: \\192.168.x.x), or use Windows' 'map network drive' function to have it show up as a drive on the user's machines.

For consistency, you might choose to 'fix' the IP address on your Samba server. There are a few ways to do this. Probably the easiest way is to reserve the IP address for that machine in your router settings.

Last edited by rkelsen; 01-28-2022 at 04:58 PM.
 
1 members found this post helpful.
Old 01-29-2022, 07:20 AM   #5
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Fantastic! Thank you. Now, if somebody could just supply as nice a set of instructions for doing the MSW 10 side . . .
ron
 
Old 01-30-2022, 12:36 AM   #6
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by JavaMeister View Post
Fantastic! Thank you. Now, if somebody could just supply as nice a set of instructions for doing the MSW 10 side . . .
ron
Already done:
Quote:
Originally Posted by rkelsen View Post
If you use the same login names & passwords on the Windows machines, the users will automatically be able to read & write the share. Depending upon your router, you might be able to browse to the share using it's name. Otherwise you can use the IP address in the File Explorer toolbar preceded by a double backslash (eg: \\192.168.x.x), or use Windows' 'map network drive' function to have it show up as a drive on the user's machines.
 
Old 01-30-2022, 12:36 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
A DuckDuckGo search for "microsoft smb "connecting to linux" produced many hits.

If we very simply reduce this problem to: "connecting from <OS#1> via <foreign-file-system> to <OS#2>," the entire problem is reduced to one that has been talked about – and solved – countless times.

As you work to diagnose such problems, remember to fully use the logging and analysis facilities at both ends, simultaneously(!), because the root cause of the problem could be at either end. It always turns out to be ... "a bi**h to discover, but trivial(?) to solve." The challenge is, usually, to find out what the problem actually is, from one-or-the-other-party's point of view. Once you solve it, the link will probably "work reliably, forever."

Last edited by sundialsvcs; 01-30-2022 at 12:40 PM.
 
Old 01-30-2022, 03:34 PM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by sundialsvcs View Post
The challenge is, usually, to find out what the problem actually is, from one-or-the-other-party's point of view. Once you solve it, the link will probably "work reliably, forever."
It's very easy. People who struggle with this are the ones who've built the problem in their own head to be much bigger than it is.

Two things to check: Firstly, can the client ping the server. If not, then that problem has to be resolved first.

Secondly, is the Samba service actually running on the server? The service doesn't start without a proper configuration, and may even silently fail to start, so it can be difficult to tell if it's running. The config file doesn't need to be very long for a single simple file share. The one I posted above is in use and working here.

If those two conditions are met, then it's "job done" 99.99% of the time.

Connecting to it is done the same way you'd connect to a Windows share from another Windows machine... i.e: You have options. Treat it the same as a Windows file share.
 
Old 02-01-2022, 07:23 PM   #9
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
Thank you rkelson and sundialsvcs for all your help. Your information enabled me to learn what I needed to know about Samba.
Learning that samba basically provides access to a directory/folder on another machine, I have decided that I really need full operating capability of my wife's machine (MSW) from mine (Linux). I will be going instead with TeamViewer. Much more suitable to my ultimate purpose.
Thank you again. Much appreciated.
r
 
Old 02-01-2022, 07:59 PM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,442
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by JavaMeister View Post
I have decided that I really need full operating capability of my wife's machine (MSW) from mine (Linux). I will be going instead with TeamViewer.
That is quite different from your original goal, and is something Samba doesn't do. The best way for us to identify which tools you should use would be to explain the problem you're trying to solve, or what it is you're trying to achieve. Do you need to be able to share files? Do you want a shared clipboard?

If you're within the same LAN, then I think using TeamViewer is a waste of internet traffic. The reason for this is that both computers will connect to each other, but the connection is via TeamViewer's servers.

A better option, IMO, is to enable Remote Desktop on the Windows machine and then connect to it from Linux using KRDC or something like that. VNC is also an option, but as I say, it really depends upon your needs.
 
Old 02-01-2022, 08:17 PM   #11
JavaMeister
Member
 
Registered: Jul 2017
Location: NC
Distribution: Ubuntu 20.04
Posts: 34

Original Poster
Rep: Reputation: Disabled
I will follow up on your advice. I share your observation of the waste of internet traffic. I don't like being unnecessarily "in the cloud" anyway.
Yes, I want to share files, share clipboard, run applications on the wife's machine including email, Quicken, etc.
Yes, we are on the same LAN. As stated in my original posting, "the Linux box [my machine] is wire-connected to the LAN and the MSW box [the wife's machine] is wirelessly connected."
I will go see what it takes to enable Remote Desktop and install KRDC. I may need to learn about VNC also. (Damn, it never quits, does it?)
I hope my information is more complete now. I know you will holler if more is needed. Again, thanks!
r
 
  


Reply

Tags
samba config allow hosts



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum Install samba "No package samba available" "No package samba-client available." young redhat Linux - Software 8 04-16-2019 08:05 PM
samba - windows files lose "created on" date stamp when moved to samba share on linux jaredk51 Linux - Software 5 02-19-2010 03:13 PM
samba does not create "samba/netlogon" and "samba/profiles" mianmajidali Linux - Server 0 04-27-2008 05:07 AM
Samba Samba Samba Bear Linux - Networking 9 01-30-2003 07:30 AM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration