Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK, so I am new to samba and Linux servers in general.
I'm looking to configure a spare PC as a home server. Primarily, it'll be a file server hosting a rather large (a few hundred GBs) amount of storage. Client computers are running Windows versions ranging from 8.1 to the venerable XP (yes, the latter is being phased out).
Goals:
All server functionality is accessible only on my LAN (no services need to be exposed to the internet as a whole)
SSH for remote control, again within the LAN only
Samba for file sharing with windows boxes on the same network
Password protected Samba shares, using accounts and passwords separate from those on the Windows boxes
Encrypted/secure shares if possible
Getting the operating system (Ubuntu 14.04 server, unless someone else has a better suggestion) installed should be no problem. Keeping things within the network should be as simple as NOT enabling port forwarding on my access point. I've configured SSH before, so that's out of the way. However, what about the remaining goals? In my previous (relatively informal) testing/research, I had trouble getting the authentication to work. I want anyone connecting to the share to first be prompted for a username/password combination. This should NOT be the same as the usernames on the client computers, which vary significantly across machines and might cause confusion for users. Also, what about encrypted connections? Passwords are sent encrypted or hashed somehow (I think?), but what about actual file content? I've read that Windows has never supported this, but Windows 7 and 8 appear to have settings regarding connection security within sharing settings. I'm confused.
The way I understand it, I will need to modify the /etc/samba/smb.conf file on the server. I know a little about this, but the default files appear to contain lots of text I don't understand. Should I modify this one, or am I better off creating a new one from scratch? What needs to be done to achieve authentication?
You need to create a user/password on your Samba server for each user, then enter those in the smbpasswd file. They can then log in with that username/password. In addition, the directories must be marked as shared in the directory configuration, which is separate from the samba configuration.
Here's a snippet from my smb.conf file, in case it helps. In my case, I allow users to log in with their normal logins/passwords, which I have configured in my Samba server as described above. I do allow guests, as the shares are available only within my own network and not public-facing
Code:
$ cat /etc/samba/smb.conf
# Global parameters
[global]
workgroup = workgroup
security = share
encrypt password = yes
smb passwd file = /etc/samba/smbpasswd
show add printer wizard = No
wins support = no
[sharefiles]
path = /path/to/some/directory
guest ok = yes
read only = no
available = yes
browsable = yes
public = yes
writable = yes
[files]
path = /path/to/some/other/directory
guest ok = yes
read only = no
available = yes
browsable = yes
public = yes
writable = yes
I cover folder permissions and samba accouts, as well as open shares. There is a simple smb.conf included as well, modified from the one provided by default in Linux Lite (which is Ubuntu based by the way).
samba is samba though, so the smb.conf configurations should be the same on other distros.
So here is what has happened since I last posted:
1. I watched the video and looked some at those sample config files. Helped a lot.
2. I finally got smbpasswd to work. (As it turns out, samba-common-bin was not installed. That was an easy fix.)
3. I tried the share on my Windows 7 box and ran into some issues, but I also happened to try it from my Win8.1 system. To my surprise, it worked as intended on the newer machine.
So now the question is why it won't work on the Windows 7 machine. I can see the server and the shared folder. When I go to access the shared folder, it prompts for a username and password, as it should. When I enter the username and password (correct or not, it doesn't matter), it bounces me back with an error message. The message (I am paraphrasing) is something like this:
Code:
***(Insert share name)*** is not accessible. You might not have permission. Please contact your administrator, etc. Multiple connections to the same resource by the same user, using more than one username are not allowed...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.