LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-11-2020, 08:26 AM   #1
sparkix
LQ Newbie
 
Registered: May 2005
Location: Toronto
Distribution: FC3/Knoppix/DSLinux
Posts: 9

Rep: Reputation: 0
Samba login problem


I have an Ubuntu server 16.04 running samba which other people log into with multiple pcs (windows and Mac). What I'm trying to do is have it log me in with the user lan-admin from my PCs but everyone else is treated as a guest and mapped to the user lan-users even if they don't enter a password (we all share the same group lan-data). Here is my config file:

Code:
[global]
unix extensions = no
follow symlinks = yes
wide links = yes
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
pam password change = yes
map to guest = bad user


[Shared]
  server string = Data Repository
  comment = File Server
  path = /data/netshare
;  force user = lan-users
  force group = lan-data
  read only = no
  create mask = 0644
  directory mask = 0755
  guest only = no
  guest ok = yes
  guest account = lan-users
  unix extensions = no
  nt acl support = no
  follow symlinks = yes
  wide links = yes
  veto files = /.DS_Store/.TemporaryItems/.Trashes/._*/Thumbs.db/.com.apple.timemachine.supported/
  delete veto files = yes
What I want is for files the "lan-admin" account adds have the owner lan-admin:lan-data while everyone else would have the owner lan-users:lan-data. That way, files I add can't be modified but they can be read.

Last edited by sparkix; 04-11-2020 at 09:25 AM.
 
Old 04-11-2020, 06:59 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
Consider using
Code:
write list = lan-admin
read list = lan-users
A simple guide...
https://www.cyberciti.biz/tips/how-d...ba-shares.html
 
Old 04-26-2020, 12:19 PM   #3
sparkix
LQ Newbie
 
Registered: May 2005
Location: Toronto
Distribution: FC3/Knoppix/DSLinux
Posts: 9

Original Poster
Rep: Reputation: 0
It turns out part of the problem was that the system was not accepting the new settings even though I was restarting the samba server. It worked after a day. I don't know if it was the Linux server or the Windows clients not updating their credentials immediately.

Anyway, it is working now. I can add files and folders using the "lan-admin" account and anyone with the "lan-users" account cannot change them. However, "lan-users" are able to add their own files which I can promote to untouchable by changing their ownership to mine.

I still have to check that anyone logging in as guest assumes the "lan-users" credentials.
 
Old 04-26-2020, 04:23 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,819

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
Thanks for the update.
 
Old 04-28-2020, 09:36 AM   #5
sparkix
LQ Newbie
 
Registered: May 2005
Location: Toronto
Distribution: FC3/Knoppix/DSLinux
Posts: 9

Original Poster
Rep: Reputation: 0
It's working they way I intended now. Here are the settings:

smbusers
Code:
# Unix_name = SMB_name1 SMB_name2 ...
lan-admin = lan-admin admin
lan-users = lan-users guest
smb.conf
Code:
[global]
unix extensions = no
follow symlinks = yes
wide links = yes
guest account = lan-users
username map = /etc/samba/smbusers

[share profile]
  comment = File Server
  path = /data/netshare
;  force user = lan-users <-- this is commented out and used to make everyone that logs on the same user
  force group = lan-data
  read only = no
  create mask = 0644
  directory mask = 0755
  guest only = no
  guest ok = yes
  nt acl support = no
  follow symlinks = yes
  wide links = yes
  veto files = /.DS_Store/.TemporaryItems/.Trashes/._*/Thumbs.db/.com.apple.timemachine.supported/
  delete veto files = yes
Works great now. Checked everything with testparm command.
 
Old 04-28-2020, 09:38 AM   #6
sparkix
LQ Newbie
 
Registered: May 2005
Location: Toronto
Distribution: FC3/Knoppix/DSLinux
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ferrari View Post
Consider using
Code:
write list = lan-admin
read list = lan-users
A simple guide...
https://www.cyberciti.biz/tips/how-d...ba-shares.html
The reason I didn't use these settings is because I do want the lan-users to be able to write to some folders (depending on the folder permission) but have other areas that are read-only to guests. But I want the lan-admin to have full access to everything.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fast login via ssh / Slow login via login manager with machine in AD-domain c01d Linux - Server 2 03-01-2016 01:52 AM
Root login but no user login on samba Cybercool Linux - Newbie 3 07-13-2011 05:36 AM
how to disable "last login log" & disable "last login message" when start login. hocheetiong Linux - Newbie 4 02-08-2011 05:35 AM
Win2k Login wont work for samba login hellertech Linux - Networking 2 07-24-2003 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:03 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