LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 07-21-2006, 01:13 AM   #1
RajendraKumar
LQ Newbie
 
Registered: Jul 2006
Posts: 21

Rep: Reputation: 15
Maping samba shared directory automaticaly


Hello All,
I have configured samba server on RHEL 3 and it is working fine.
Now I want to share a directory that will be automaticaly mounted when login on to a windows XP/2000 machine.

My configuration part of smb.config is as below

[ITM DATA]
comment = File Server - ITM
path = /ITM DATA
writeable = yes
guest ok = yes

[cdrom]
path = /mnt/cdrom
guest ok = yes


[itmbhl]
comment = Database
path = /itmbhl
valid users = raj
writeable = yes
create mask = 0765
printable = no
public = no

Please help me.
Have a nice day,

Rajendra
 
Old 07-21-2006, 01:22 AM   #2
abakali
Member
 
Registered: Dec 2005
Location: karachi
Distribution: RedHat
Posts: 75

Rep: Reputation: 15
Samba Domain Control

[global]

;basic server settings
workgroup = home-domain
server string = ClarkConnect
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
wins support = yes

;PDC and master browser settings
os level = 64
preferred master = yes
local master = yes
domain master = yes
domain logons = yes

;security and logging settings
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
log file = /var/log/samba/log.%m
log level = 2
max log size = 50
hosts allow = 127.0.0.1 192.168.1.0/255.255.255.0
interfaces = eth1 192.168.1.0/255.255.255.0 127.0.0.1

;user profiles and home directory
logon path = \\%L\profiles\%U
logon script = netlogon.bat your mount drives scripts

# ==== shares ====

[homes]
comment = Home Directories
browseable = no
writeable = yes

[profiles]
path = /home/samba/profiles
profile acls = yes
writable = yes
browseable = no
guest ok = yes

[netlogon]
comment = Network Logon Service
path = /home/netlogon
guest ok = yes
writable = no
share modes = no

[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes

--------------------------------------------------------------------------------


Ok, just change the server-string to be the name that you want your ClarkConnect box to have, and the workgroup to be the name of your domain. Save it as /etc/samba/smb.conf

Next we need to do some housekeeping and create some groups, directories and machine trust accounts. Again, as root do the following:

Code:
--------------------------------------------------------------------------------

groupadd -g 200 admins
groupadd -g 201 machines

mkdir -m 0775 /home/netlogon
chown root.admins /home/netlogon
mkdir /home/samba /home/samba/profiles
chmod 1757 /home/samba/profiles

--------------------------------------------------------------------------------


These steps create the necessary directories. The permissions and owners are quite important, as giving the wrong people access to, say for instance, the netlogon directory then they could make every windows machine that logs on to the domain run any particular program/command... ie it is quite a big backdoor which you want firmly locked.

Ok, now check to see if everything is fine, and restart samba with the following commands:

Code:
--------------------------------------------------------------------------------

testparm -x |more
/etc/init.d/smb restart

--------------------------------------------------------------------------------


this will (after hitting enter) check smb.conf to make sure there is nothing seriously wrong with it, and it will spit out the specifics of what you have configured. The second command stops and restarts samba. If you don’t have samba running then you can just use start instead of restart. To make samba start up on boot you can use the web based configuration of CC.

Machine trust accounts are what the windows machines log in to the domain with. There is/was a way of doing this automagically the first time a machine connects, but i haven’t worked out how to do it in Samba 3 yet. There doesn’t seem much point as I’m only connecting 3 computers to my domain. Here is how you creat a machine account for a computer with the network id of “flower”

Code:
--------------------------------------------------------------------------------

useradd -g machines -d /dev/null -c “Trust Account” -s /bin/false flower$
passwd -l flower$
smbpasswd -a -m flower

--------------------------------------------------------------------------------


Yes, the ‘$’ sign is important. Don’t leave it out of the first two commands or it won’t work. The second command there creates a locked password for the machine. The third command sets the samba password for the machine, this time don’t include the ‘$’ sign.

Next you need to create the login for the profile you want to use on your new domain. In this case the login name is fred.

Code:
--------------------------------------------------------------------------------

useradd fred
passwd fred

--------------------------------------------------------------------------------


Now type in the new password for fred as prompted (twice) (this one isn’t the one you’ll log in with from your windows machine, but you might as well make it the same)

Code:
--------------------------------------------------------------------------------

smbpasswd -a fred

--------------------------------------------------------------------------------


This password is the windows domain password for the user fred in the domain HOME-DOMAIN

In order to allow machines to join the domain you need to create a samba password for the root account. You do this by typing in the command below then typing in a password.

Code:
--------------------------------------------------------------------------------

smbpasswd -a root
 
Old 07-21-2006, 03:54 AM   #3
RajendraKumar
LQ Newbie
 
Registered: Jul 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by abakali
[global]

;basic server settings
workgroup = home-domain
server string = ClarkConnect
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
wins support = yes

;PDC and master browser settings
os level = 64
preferred master = yes
local master = yes
domain master = yes
domain logons = yes

;security and logging settings
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
log file = /var/log/samba/log.%m
log level = 2
max log size = 50
hosts allow = 127.0.0.1 192.168.1.0/255.255.255.0
interfaces = eth1 192.168.1.0/255.255.255.0 127.0.0.1

;user profiles and home directory
logon path = \\%L\profiles\%U
logon script = netlogon.bat your mount drives scripts

# ==== shares ====

[homes]
comment = Home Directories
browseable = no
writeable = yes

[profiles]
path = /home/samba/profiles
profile acls = yes
writable = yes
browseable = no
guest ok = yes

[netlogon]
comment = Network Logon Service
path = /home/netlogon
guest ok = yes
writable = no
share modes = no

[tmp]
comment = Temporary file space
path = /tmp
read only = no
public = yes

--------------------------------------------------------------------------------


Ok, just change the server-string to be the name that you want your ClarkConnect box to have, and the workgroup to be the name of your domain. Save it as /etc/samba/smb.conf

Next we need to do some housekeeping and create some groups, directories and machine trust accounts. Again, as root do the following:

Code:
--------------------------------------------------------------------------------

groupadd -g 200 admins
groupadd -g 201 machines

mkdir -m 0775 /home/netlogon
chown root.admins /home/netlogon
mkdir /home/samba /home/samba/profiles
chmod 1757 /home/samba/profiles

--------------------------------------------------------------------------------


These steps create the necessary directories. The permissions and owners are quite important, as giving the wrong people access to, say for instance, the netlogon directory then they could make every windows machine that logs on to the domain run any particular program/command... ie it is quite a big backdoor which you want firmly locked.

Ok, now check to see if everything is fine, and restart samba with the following commands:

Code:
--------------------------------------------------------------------------------

testparm -x |more
/etc/init.d/smb restart

--------------------------------------------------------------------------------


this will (after hitting enter) check smb.conf to make sure there is nothing seriously wrong with it, and it will spit out the specifics of what you have configured. The second command stops and restarts samba. If you don’t have samba running then you can just use start instead of restart. To make samba start up on boot you can use the web based configuration of CC.

Machine trust accounts are what the windows machines log in to the domain with. There is/was a way of doing this automagically the first time a machine connects, but i haven’t worked out how to do it in Samba 3 yet. There doesn’t seem much point as I’m only connecting 3 computers to my domain. Here is how you creat a machine account for a computer with the network id of “flower”

Code:
--------------------------------------------------------------------------------

useradd -g machines -d /dev/null -c “Trust Account” -s /bin/false flower$
passwd -l flower$
smbpasswd -a -m flower

--------------------------------------------------------------------------------


Yes, the ‘$’ sign is important. Don’t leave it out of the first two commands or it won’t work. The second command there creates a locked password for the machine. The third command sets the samba password for the machine, this time don’t include the ‘$’ sign.

Next you need to create the login for the profile you want to use on your new domain. In this case the login name is fred.

Code:
--------------------------------------------------------------------------------

useradd fred
passwd fred

--------------------------------------------------------------------------------


Now type in the new password for fred as prompted (twice) (this one isn’t the one you’ll log in with from your windows machine, but you might as well make it the same)

Code:
--------------------------------------------------------------------------------

smbpasswd -a fred

--------------------------------------------------------------------------------


This password is the windows domain password for the user fred in the domain HOME-DOMAIN

In order to allow machines to join the domain you need to create a samba password for the root account. You do this by typing in the command below then typing in a password.

Code:
--------------------------------------------------------------------------------

smbpasswd -a root
WoW Its working fine ,Thanks My dear,Thanks A lot
Have a nice day,

Rajendra
 
Old 07-21-2006, 05:57 AM   #4
RajendraKumar
LQ Newbie
 
Registered: Jul 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by RajendraKumar
WoW Its working fine ,Thanks My dear,Thanks A lot
Have a nice day,

Rajendra
Hello Now I want to share a directory which will open directly without any username and password through any windows machine

like
typing in start->run itmserver

then that shared directory will flash

please help me

thanks

Rajendra
 
  


Reply



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
samba maping (home) is not working procfs Linux - Software 1 06-26-2006 04:21 AM
shared directory allelopath Linux - Networking 7 03-19-2006 02:01 PM
Linux shared directory for XP sjmgeezer Linux - Networking 1 06-03-2005 09:49 PM
Shared directory Sir.Del Linux - General 1 07-27-2004 12:35 PM
Problem with shared directory Tezdread Linux - Networking 5 03-16-2004 04:46 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

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