LinuxQuestions.org
Help answer threads with 0 replies.
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 08-13-2010, 08:29 AM   #1
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Rep: Reputation: 0
Samba setup issues


I have a Linux server running Redhat Enterprise 5.4 I think it is, Linux version 2.6.18-165.9.1.el5. This is not going to be a Samba server all I am trying to do is map to two shares on a Windows server. The issues I am having are related to the Linux configuring and not the windows side. So I assume all I need to do is a samba client setup. I am learning Linux as I go along so please bear with me.

I have done some preliminary checks and maybe I'm doing something wrong or have missed something hopefully someone can help.

I have checked to see if the samba packages are installed,
rpm -qa | grep samba results
system-config-samba-1.2.41-5.el5
samba-client-3.0.33-3.15.el5_4.1
samba-3.0.33-3.15.el5_4.1

I checked the smb daemon and the run levels were all off so I set it to
chkconfig --level 2345 smb on

When I try to start the smb daemon
service smb start
the command completes with no response

When I check it
service sbm status results
smbd is stopped
nmbd is stopped

So the first issue I'm having is smb will not start. (Maybe has something to do with not being able to edit smb.conf?)

If I try to go into System-Administation-Server Settings-Samba-Samba Server Configuration (I'm thinking I don't need to do this but I'm trying it anyway) and if I try to configure something I get a
"Cannot write to /etc/samba/smb.conf. Program will now exit." error.

If I try to vi into smb.conf and edit I get "E212: Can't open file for writing." message and forcing the overwrite doesn't work.

The /etc/samba directory is owned by root and the permissions of smb.conf are 644.

By the way I do have root access and have SU'd to root.

I can't find a swp file that might be locking smb.conf but there is a file in /etc/samba named "smb.conf;4b883068" what it's for I have no idea.

There are a few other things I have done to prepare the samba client such setting up the mount point in /mnt, setup the hosts file, created the credentials file but have not done the /ect/fstab setup yet.

That's where I'm at hopefully someone can show me what I'm doing wrong or have missed.

Thanks in advance.
 
Old 08-13-2010, 10:39 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
did you install samba-common package?

install that package and try to restart smb service.
 
Old 08-13-2010, 10:47 AM   #3
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
No I didn't. I'll see about that and let you know.
 
Old 08-13-2010, 10:59 AM   #4
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Samba setup issues

One other thing. I'm a little unsure of which package to install. I found this package, samba-common-3.0.33-3.15.el5_4.1:0.x86_64 on Redhat's website. It appears to be similar version to the other samba packages that are installed. I always notice that the architecture changes on the download page. Like this one says

Arch: AMD64
Available Archs: AMD64 , i386 , ia64 , ppc , ppc64
 
Old 08-13-2010, 11:07 AM   #5
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
samba-common package available on you redhat media. if you have yum access then you can install from yum repo.

Code:
yum install samba-common
or you can install from your media.

you can run uname command to find your platform

Code:
uname -a
if your Linux is 32 bit it display
Code:
Linux shailesh 2.6.18-53.el5 #1 SMP Wed Oct 10 16:34:02 EDT 2007 i686 i686 i386 GNU/Linux
if 64bit it display
Code:
Linux shailesh 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
HTH

Last edited by sem007; 08-13-2010 at 11:12 AM. Reason: provide more info
 
Old 08-20-2010, 10:18 AM   #6
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Samba setup issues

I went ahead and uninstalled samba and installed samba3x.
So now I have,
samba3x-3.3.8-0.51.el5
samba3x-common-3.3.8-0.51.el5
samba3x-winbind-3.3.8-0.51.el5
samba3x-client-3.3.8-0.51.el5

I was abe to install samba3x-common this time. I would receive errors prior when trying to install the previous version samba-common.

Anyway, neither smb or winbind still will start. If I run service smb start, smb should be running correct?
I now have several smb.conf;xxxxxxxx numbered files now in /etc/samba

I cannot do anything to the smb.conf file. And I am logged as root.

[username@servername samba]# su - root
Password:xxxxx

It asks me if I agree to these terms yes or no and I type yes. Which then brings me to,
[root@servername samba]#

Like I stated earlier I am not able to modify smb.conf. If I try to vi into smb.conf and edit I get "E212: Can't open file for writing." message and forcing the overwrite doesn't work. I cannot do anything to it. Even change the permissions.

The /etc/samba directory is owned by root and the permissions of smb.conf are 644.

When I vi into smb.conf and as soon as I try to insert something I get,

W10: Warning Changing a readonly file

I type the text anyway, and when trying to save by typing :wq!

I get, "smb.conf" E212: Can't open file for writing

Do I need to have system-config-samba installed? There is a system-config-samba-1.2.41-5.el5 file out there but it appears it needs samba and will not work with samba3x.

When smbd is stopped that does mean samba is not running correct?
When I try to start the smb daemon
service smb start
the command completes with no response

When I check it
service sbm status results
smbd is stopped

What's weird was yesterday I was able to map to a windows share and move files over to it.

I'm at a loss here. While it appears to be working but then again several other issues on the linux box show it's not. I'm in a crunch to get this working and working properly, I need to be able to configure that smb.conf file.

Last edited by BlackCrowe; 08-20-2010 at 10:19 AM. Reason: grammer
 
Old 08-20-2010, 10:50 AM   #7
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
hmm....

Quote:
I now have several smb.conf;xxxxxxxx numbered files now in /etc/samba
I think those are rpmsave file of previous packages.

Quote:
It asks me if I agree to these terms yes or no and I type yes. Which then brings me to,
I never seen this type of message when i do su. Can you provide more info about it?

and also give output of below command
Code:
# id root
# lsattr -d /etc/samba/
# lsattr /etc/samba/
Quote:
When smbd is stopped that does mean samba is not running correct?
When I try to start the smb daemon
service smb start
the command completes with no response
yes smbd stop means samba not running.

monitor log file and see is there any error related samba?

Code:
# tail -f /var/log/messages
 
1 members found this post helpful.
Old 08-20-2010, 11:19 AM   #8
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
samba aetup issues

The agree to terms thing is just a message saying that your session is subject to consent to monitoring... blah blah blah ... Do you agree to these terms yes or no. It's required to be there on our systems.

Here's what I got on your other questions.

id root

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),501(createdgroup1) context=root:system_r:unconfined_t:SystemLow-SystemHigh

lsattr -d /etc/samba

-------------------- /etc/samba

lsattr /etc/samba

-------------------- /etc/samba/lmhosts.rpmnew
-------------------- /etc/samba/dump_cred
-------------------- /etc/samba/secrets.tbd
-------------------- /etc/samba/smbpasswd_old
-------------------- /etc/samba/smb.conf_org
-------------------- /etc/samba/fta_cred
-------------------- /etc/samba/smbusers
-------------------- /etc/samba/smb.conf.rpmnew
-------------------- /etc/samba/smb.conf
-------------------- /etc/samba/smbpasswd
-------------------- /etc/samba/lmhosts
-------------------- /etc/samba/passdb.tbd

I'll check the logs again. I don't recall any samba related entries. WOuld that be in any special log?
 
Old 08-20-2010, 11:44 AM   #9
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
You dont need to run a samba server if all you want to do is mount a windows driveshare. Most of those packages are related to the server. Am I missing something here? Just mount the windows share:

mount -t cifs //10.0.1.2/sharename -o username=Administrator,password=password /mnt/whatever/
 
Old 08-20-2010, 11:50 AM   #10
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by suprstar View Post
You dont need to run a samba server if all you want to do is mount a windows driveshare. Most of those packages are related to the server. Am I missing something here? Just mount the windows share:

mount -t cifs //10.0.1.2/sharename -o username=Administrator,password=password /mnt/whatever/
@suprstar
As i understand OP want to mount shares on windows server ( #1 post)

Quote:
This is not going to be a Samba server all I am trying to do is map to two shares on a Windows server.
 
Old 08-20-2010, 12:03 PM   #11
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
Right, so why can't he just mount them? The mount command doesn't care what kind of server is offering the drive share.
 
Old 08-20-2010, 12:09 PM   #12
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by suprstar View Post
Right, so why can't he just mount them? The mount command doesn't care what kind of server is offering the drive share.
Can you tell me how can i mount sharedrive in windows without sharing on linux?
 
Old 08-20-2010, 12:19 PM   #13
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
Maybe I'm misunderstanding. I thought the OP has a windows server offering a drive share, and he wants to mount it in a mount point on his linux box.

mount -t cifs //10.0.1.2/sharename -o username=Administrator,password=password /mnt/whatever/

10.0.1.2 is the ip of the windows server. Username/password on the windows server are 'Administrator' and 'password'. The windows driveshare is called 'sharename'. Run that mount command, and the windows server driveshare will appear in the linux filesystem at /mnt/whatever. Mounting this share will not cause the linux box to share it with anyone else, unless he runs samba. But he stated in the OP that "This is not going to be a Samba server" - so I assume he doesnt want the linux box to share it. ?
 
Old 08-20-2010, 12:45 PM   #14
BlackCrowe
Member
 
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
That would explain why I was able to mount to a Windows share yesterday. I'm a newbie so bear with me. I thought I needed to have samba. So are you saying if I totally uninstalled the samba packages I would still be able to mount to a windows share?
I did do the mount -t cifs //10.0.1.2/sharename -o username=Administrator,password=password /mnt/whatever/
yesterday and it did work.

But there is still an issue of why I cannot edit the smb.conf file. There are some requirements that we need to do here and one of them is some configuring of that file.

aside from that I also want to use password encryption. Doesn't the smb.conf file need to have that set?

I am trying to configure in the smb.conf file

security = user
encrypt password = yes
smb passwd file = /etc/samba/smbpasswd


along with creating the smbpasswd file

cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

If samba is not needed than that's great. But it would be nice to have it working in case I need it later.

Last edited by BlackCrowe; 08-20-2010 at 12:47 PM. Reason: add text
 
Old 08-20-2010, 01:15 PM   #15
suprstar
Member
 
Registered: Aug 2010
Location: Atlanta
Distribution: ubuntu, debian
Posts: 142
Blog Entries: 2

Rep: Reputation: 22
No. smb.conf and anything samba is strictly for the local samba server, it has nothing to do with mounting any drive shares on any other server. So I'm not sure why you think you need to edit it. Yes, you could uninstall ALL of it and the mount command would still work. smbpasswd is the password file for users connecting to your linux box, again, completely irrelevant to what you're doing. I beleive you can make samba use /etc/passwd to authnticate instead of its own smbpasswd file anyway. So if you were gonna run the whole /etc/passwd file thru some script to give all the users samba access, you don't need to do that anyway.

Last edited by suprstar; 08-20-2010 at 01:16 PM.
 
  


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
OpenVPN Setup Issues metallica1973 Linux - Networking 6 10-11-2010 07:52 AM
mrepo setup- issues jbeiter Red Hat 8 02-11-2010 06:50 AM
LineControl: issues with setup Lucky Dragon Linux - Software 0 05-22-2007 11:48 PM
I need the content from thegoldenear.org/toolbox/unices/samba/samba-setup.html rtg2001 Linux - Networking 1 08-05-2004 06:54 PM
SuSE 9.1 Pro, Static IP setup and SAMBA issues enygma Linux - Networking 2 07-22-2004 07:58 PM


All times are GMT -5. The time now is 08:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration