LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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-11-2009, 01:23 AM   #1
linux4shakir
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Samba Share on Linux


Hi All,

I am using RHEL 5.2 server, I need two shares on it one share should be access by all office guy, and otherone should require authentication (samba user & password) from windows xp. I need your help, please do needful for me.


Thanks
Shakir

System Administrator
 
Old 08-11-2009, 02:48 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by linux4shakir View Post
Hi All,

I am using RHEL 5.2 server, I need two shares on it one share should be access by all office guy, and otherone should require authentication (samba user & password) from windows xp. I need your help, please do needful for me.


Thanks
Shakir

System Administrator
Easiest ways: install samba-swat (web front end) and use that....or even system-config-samba.

To configure with swat, go to
Code:
 http://localhost:901

Quickest way is editing the /etc/samba/smb.conf

There are plenty of examples in there where you can uncomment lines and add extra directives to get some of those samples working.
 
Old 08-11-2009, 04:36 AM   #3
linux4shakir
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for reply, can you tell me where i have to make changes in smb.conf file in such a way that both shares can work according to my requirement.

Thanks,
Shakir

Quote:
Originally Posted by centosboy View Post
Easiest ways: install samba-swat (web front end) and use that....or even system-config-samba.

To configure with swat, go to
Code:
 http://localhost:901

Quickest way is editing the /etc/samba/smb.conf

There are plenty of examples in there where you can uncomment lines and add extra directives to get some of those samples working.
 
Old 08-11-2009, 08:17 AM   #4
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL 4
Posts: 360

Rep: Reputation: 29
for authentication based sharing you would need to make the samba server as a PDC (Primary Domain Controller) and for a simple share you just uncomment the samples share in the end of smb.conf file.
 
Old 08-11-2009, 11:36 PM   #5
linux4shakir
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by shahz View Post
for authentication based sharing you would need to make the samba server as a PDC (Primary Domain Controller) and for a simple share you just uncomment the samples share in the end of smb.conf file.


Thanks for your reply, is there anyway to make these share without making linux machine PDC. Actually this a workstation i have installed two HDD on it one is 320 GB and other is 1 TB. The drive which is 1 TB is for everyone but 320 GB drive only for one group which require authentication. can you help me in this.

Thanks
Shakir
 
Old 08-12-2009, 03:09 AM   #6
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by linux4shakir View Post
Thanks for your reply, is there anyway to make these share without making linux machine PDC. Actually this a workstation i have installed two HDD on it one is 320 GB and other is 1 TB. The drive which is 1 TB is for everyone but 320 GB drive only for one group which require authentication. can you help me in this.

Thanks
Shakir
you have to use the
Code:
 guest ok = yes
directive for shares without user/pass.
Other shares, you add the user/pass using
Code:
smbpasswd -a user
You have to mix and match with the examples already provided in the /etc/samba/smb.conf file.

example: look for the sample config for sharing homes.

mine looks like this

Code:
[homes]
        comment = Home Directories
        browseable = yes
        writable = yes
        hosts allow = 192.168.1.
;       valid users = %S
;       valid users = MYDOMAIN\%S
To access this from a windows machine, i first run this on the linux box

Code:
smbpasswd -a user
then give that user a password. that user also exists in the /etc/passwd file.

Now i access from a windows box and im presented with the login prompt.
once i login in a directory from which i can see my home directory.

others could also access this directory - if they know the login details.
 
Old 08-12-2009, 06:31 AM   #7
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL 4
Posts: 360

Rep: Reputation: 29
for authentication based samba you need to make it as PDC.
 
Old 08-12-2009, 06:44 AM   #8
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by shahz View Post
for authentication based samba you need to make it as PDC.
is this correct??
i run samba in many locations, and i have a PDC in none of them...

Code:
testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = MYGROUP
        server string = Samba Server Version %v
        passdb backend = tdbsam
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No
 
Old 08-12-2009, 06:59 AM   #9
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Hello,

@shahz: This is not necessary at all if you just want to access the shares using a locally known user on the Samba server. It's only necessary to set it up as a domain controller if you want to do authentication using domain users, like for example in a mixed Windows/Linux environment where you want the Windows users to be able to access the Linux Samba shares.

@linux4shakir

Create your users locally on the Linux box and change the smb.conf file to allow access to the shares according to your wishes. Just like centosboy has explained.

Kind regards,

Eric
 
Old 08-12-2009, 07:01 AM   #10
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by EricTRA View Post
Hello,

@shahz: This is not necessary at all if you just want to access the shares using a locally known user on the Samba server. It's only necessary to set it up as a domain controller if you want to do authentication using domain users, like for example in a mixed Windows/Linux environment where you want the Windows users to be able to access the Linux Samba shares.

@linux4shakir

Create your users locally on the Linux box and change the smb.conf file to allow access to the shares according to your wishes. Just like centosboy has explained.

Kind regards,

Eric


i was beginning to doubt myself for a minute...
 
Old 08-12-2009, 07:06 AM   #11
EricTRA
Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290Reputation: 1290
Quote:
Originally Posted by centosboy View Post


i was beginning to doubt myself for a minute...
Never do, just think/ask/read/find out/investigate/google/....

Lot's of options to follow before doubting yourself

Kind regards,

Eric
 
Old 08-12-2009, 07:56 AM   #12
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by EricTRA View Post
Never do, just think/ask/read/find out/investigate/google/....

Lot's of options to follow before doubting yourself

Kind regards,

Eric
i was joking.
i cant doubt myself if i have it all set up and running with no problems
 
Old 08-12-2009, 08:04 AM   #13
shahz
Member
 
Registered: Sep 2006
Location: Quetta, Pakistan
Distribution: RHEL 4
Posts: 360

Rep: Reputation: 29
Quote:
Originally Posted by centosboy View Post
is this correct??
i run samba in many locations, and i have a PDC in none of them...

Code:
testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        workgroup = MYGROUP
        server string = Samba Server Version %v
        passdb backend = tdbsam
        cups options = raw

[homes]
        comment = Home Directories
        read only = No
        browseable = No

[printers]
        comment = All Printers
        path = /var/spool/samba
        printable = Yes
        browseable = No
can you send me the complete smb.conf file where its not a PDC and it authenticates, it would be new for me also as I am a also learner.
 
Old 08-12-2009, 08:21 AM   #14
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The directory for the public share should be like the /tmp directory. You need to set the sticky bit. This will prevent one user from deleting another user's file.

I would highly recommend that you download these two samba books:
http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
http://www.samba.org/samba/docs/Samba3-ByExample.pdf

You didn't indicate how many users this is for. That could determine the password database you want to use, and whether you want to use a domain. Also, consider how you want users to change their passwords. You need each Windows user to also be a Linux user. If you don't run a domain controller or Active Directory, how do you want changes in a users credentials to be replicated to samba? A domain controller, either this samba server, or one you have becomes a central source for validating credentials. That means when they change their password, they modify their credentials on the server. Otherwise, you need to run "smbpasswd" to change their password for them. If some of the computers are XP Home editions, this is what you will have to do. XP Home can't join a domain.

It is important to plan ahead, and understand how your network will operate with your design before you implement it. Also don't forget a backup plan. If you don't back up certain *.db files that samba uses, you will look everyones credentials if you upgrade in the future.

Good Luck!

Last edited by jschiwal; 08-12-2009 at 08:26 AM.
 
Old 08-12-2009, 10:04 AM   #15
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by shahz View Post
can you send me the complete smb.conf file where its not a PDC and it authenticates, it would be new for me also as I am a also learner.
all you need for now is your view your own smb.conf file.
go to the end and find the section for [homes]
normally it is all ready and set up.
all you need to do is add the smb user(s), start samba and ensure the relevant ports are allowing access.

like the post above says there are some security issues when it is for user(s) access rather then just a simple plain user.
once you see how this works, then you can begin to fine tune it properly with security in mind.
 
  


Reply

Tags
rhel, samba, share


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
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM
Samba OS X to Linux Samba file share error ttoomey Linux - Software 1 08-16-2005 10:12 AM
samba: linux mounted share = choppy playback, windows mounted share = smooth kleptophobiac Linux - Software 2 04-10-2005 08:23 AM
possible to see a Linux SAMBA File share... Russ3482 Linux - Software 1 08-11-2004 02:17 PM
XP not able to mount Linux share through SAMBA Peter2003 Linux - Software 2 06-04-2003 11:05 PM


All times are GMT -5. The time now is 06:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration