Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I'm having a problem with samba. This is the first time I've tried to configure it and it works fine logged in as root.
I just type samba start and it starts up fine.
Then when I login in my user account i type samba start and I get a path error - command not found.
Someone guided me through fixing that with something else so I added the following to my ~.bash_profile file
Code:
export PATH=$PATH:usr/sbin
That seemed to fix the path problem and I could then type samba start.
However I now get the following message when I type samba start in a terminal...
Code:
Starting SMB services: smbd: Version 2.0.10-ja-1.1 : Must have effective user id of zero to run.
[FAILED]
Starting NMB services: [OK]
Anyone know how to fix this one?
When I login as root it starts up fine.
Is there a permission on a file somewhere that needs to be changed? That's the only reason I can think of as to why it works as root and not as a normal user - though I am completely new to Linux.
The path fix is probably a bad idea, why? Because in most cases Samba and most all services should only be run by root. In fact the programs in the '/sbin' directory should only be run by root.
If you want to run samba as non root, you must enable it as a service. Usually RH allowed you to run '/etc/init.d/smb start' (as root). Look into 'chkconfig' and the 'service' command.
The only folder being shared by samba is a subfolder of my home folder (when not logged in as root) - so nothing of critical importance could be affected I don't think.
Oh I didn't realise I just had to type all that in.
Just tried it and none of these seem to do anything.
On a command prompt as root typing...
/etc/init.d/smbd start
I get 'no such file or directory' error.
Typing...
chkconfig
I just get the help for that command.
Typing...
service
I get the help again
And typing...
serviceconf
I just get 'command not found'
Is that meant to enable samba as a service?
I would have thought enabling something as a service would be slightly more involved than that.
I have no ideas what the above commands are meant to do. What's their proper usage with regards to getting samba working when I'm not logged in as root?
Basically I want to have samba started when I logon to my user account (not root).
Am I going about this the right way?
use root to controll services. that is what you are doing. open up a terminal, log in as user, su - to root, then run the above command i gave you. then you can logout/exit out of both root and user and be happy.
what you do not want to do is use the root account as your primary account. use root for what it is there for. configuring and changing things to the system. for normal use of programs and files, stick with user. that is what it is there for.
I want to try and get samba to run automatically when I start my system.
Is there any way to do this?
I guess I could add that command to the ~bash profile file in root then login to root.
Then immediately log out once the samba service has started.
I basically want to be able to boot my machine and then use samba.
It would be even better if samba was starting before my machine got to the login prompt.
Is that possible?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.