LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-08-2006, 01:26 PM   #1
Questor21
LQ Newbie
 
Registered: Apr 2006
Posts: 8

Rep: Reputation: 0
Running samba as a user other than root


Its me again ,

I'm using su -c to launch smbd and nmbd as a user other than root in an rc.samba script. But despite the commands running apparently fine, no log entries are generated and the processes are not running
 
Old 04-08-2006, 07:53 PM   #2
Questor21
LQ Newbie
 
Registered: Apr 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Still having this trouble... Completely baffled..
 
Old 04-09-2006, 01:36 AM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
System services are ment to be run as root. Can I ask what you are trying to do with samba and why you want to run it as a non-root user? Be specific in your questions, you will get a better responce.

regards,
...drkstr
 
Old 04-09-2006, 01:56 AM   #4
Questor21
LQ Newbie
 
Registered: Apr 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I'm using samba for a basic linux client -> windows client drive mounting. I want it run as a non root user because should someone exploit the service and gain the ability to run code with the service owner's permissions then I want to minimize the damage.
 
Old 04-09-2006, 02:33 AM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Last I checked, what you are trying to do is not possible. Samba needs root privileges for certain file operations to allow access for "non privileged" windows users. I would instead try to focus on good access policies with hosts.allow and hosts.deny, iptable filtering and implementing encrypted samba passwords. If you find out otherwise, please let me know, I would be interested learning how to do it.

regards,
...drkstr
 
Old 04-09-2006, 05:06 AM   #6
baskar_k
LQ Newbie
 
Registered: Mar 2006
Posts: 12

Rep: Reputation: 1
Hi,
Why not add the windows share in /etc/fstab or else chmod 'smbmnt' so that non-root users can mount the windows share using userid and password.
 
Old 04-09-2006, 01:03 PM   #7
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
Yea that's no problem, non root users can mount samba drives if they are given permission to do so. I thought you were doing it the other way around. The smbd service is to allow other computers access to the samba share on your linux box, which has to be run as root. If just want to mount a samba share from a windows computer, you just need to add this to your fstab:

Code:
//computername/share   /mnt/share   smbfs   gid=users,rw,username=Win32UserName,passwd=Win32Password  0 0
the /mnt/share directory must be owned by the users group.

For added security, you can store the username/password in a seperate file /etc/smb-credentials. The format to this file is as follows:

Code:
username = _*username*_
password = _*password*_
domain = _*domain*_
Make sure you cmod 640 /etc/smb-credentials so only root can read this file. The domain line is not needed if it is in your smb.conf file.

you would then mount the drive like this:

Code:
//computername/share     /mnt/share      smbfs   gid=users,rw,credentials=/etc/smb-credentials  0  0
If you don't want it to mount on boot, add in noauto in the options and you can mount the share by typing mount /mnt/share.

Hope this helps!
...drkstr
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Running Nmapfe as non-root user XaViaR Linux - General 3 06-10-2005 06:04 AM
Running user program from root kilativv Linux - Software 2 07-31-2004 01:49 AM
Running KPPP as a user, and not root. RoaCh Of DisCor Linux - Software 5 06-28-2004 06:38 AM
Help me get KDE running as a non root user vdogvictor Slackware 8 06-27-2004 09:27 PM
Running xcdroast as non-root user kermit Linux - Newbie 2 07-07-2002 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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