LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-22-2004, 05:20 PM   #1
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Rep: Reputation: 23
starting smb services failed...


Hi,

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.

Any help will be greatly appreciated.

Thanks

Ben
 
Old 11-22-2004, 07:27 PM   #2
mjmwired
Member
 
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
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.
 
Old 11-23-2004, 04:57 PM   #3
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
Hi.

How do I enable samba as a service?

Once I've done that how do I start samba?

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.

Thanks

Ben
 
Old 11-23-2004, 06:20 PM   #4
mjmwired
Member
 
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
Did you try '/etc/init.d/smbd start' ?
Did you try 'chkconfig' or 'service' or 'serviceconf'?
 
Old 11-23-2004, 07:14 PM   #5
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
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?

Thanks for your help so far.

Ben
 
Old 11-23-2004, 08:05 PM   #6
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
in RH its

/etc/rc.d/init.d/smb restart

or stop or start depending on what you need/want to do with that service.

check out this HOWTO for samba. it is written for RH in mind. very awsome and easy to follow:

http://home.nyc.rr.com/computertaijutsu/samba.html

enjoy.
 
Old 11-24-2004, 03:59 PM   #7
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
Hi

Just tried typing that. When *not* logged in as root

And I'm getting the same error as before

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]
What does that mean? Effective user id of zero?

Is there a way to run samba without being root?

I was told it's dangerous to login as root all the time but it seems being root is the only way to actually get anything working.

Thanks

Ben
 
Old 11-24-2004, 05:06 PM   #8
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
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.
 
Old 11-24-2004, 05:16 PM   #9
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
Yeah that works fine when I'm logged in as root.

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?

Thanks for all your help

Ben
 
Old 11-24-2004, 06:47 PM   #10
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
To get samba to start automatically when the system boots up, type in (as root):

chkconfig smbd on
chkconfig nmbd on

That will start samba up automatically for RH. For other Linux variants, you would need a startup script in /etc/init.d.

-twantrd
 
Old 11-25-2004, 09:25 AM   #11
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
So if I type that as root, that will work even if I login as a normal user?

Thanks

ben
 
Old 11-25-2004, 04:43 PM   #12
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
Hi

Just tried that and I get the message...

Error reading information on service smbd: No such file or directory

I was logged in as root.

Any ideas as to why this is happening?

Thanks

Ben
 
Old 11-25-2004, 05:13 PM   #13
tisource
Member
 
Registered: Feb 2002
Posts: 322

Rep: Reputation: 30
Yeah, on RH and MDK its:

chkconfig smb on
chkconfig nmd on

Then it will run at startup
 
Old 11-25-2004, 07:41 PM   #14
batfastad
Member
 
Registered: Nov 2004
Location: London, UK
Distribution: CentOS, RHEL, Debian, IPCop, PS2Linux
Posts: 95

Original Poster
Rep: Reputation: 23
Hi

Tried the smb one and it worked fine!
Well I think it worked fine.
I just got a new line on the command prompt.

But when trying the 'chkconfig nmb on' command I get...

Error reading information on service nmb: No such file or directory

What is NMB?
Does it need to be on in order for me to use samba correctly?

Will this mean samba will start even if I login as a user and not root?

Thanks for all your help.

Ben
 
Old 11-26-2004, 12:26 AM   #15
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
nmbd - NetBIOS name server to provide NetBIOS over IP naming services to clients

My understanding is yes...you need nmbd to run smb correctly.

-twantrd
 
  


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
SMB services tonyr321 Linux - Newbie 3 10-21-2005 03:04 PM
SMB connection failed sichen Linux - Networking 1 08-13-2004 08:51 PM
Start services automatically (httpd & SMB) krazyglue Linux - Newbie 8 07-11-2004 03:48 AM
SMB connection failed Geefthegreat Linux - Networking 3 03-31-2004 07:04 AM
SMB Failed rbanonuevo Linux - Newbie 1 01-24-2002 08:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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