Archive

Posts Tagged ‘Samba’

How to use samba to map a Linux Directory to a Windows Drive

March 22, 2010 Leave a comment

1. First install samba.

2. create samba users
sudo smbpasswd -a usname

3. Manully configure samba with /etc/samba/smb.conf

a sample conf file could be:

[homes]
comment=Home directories
path =/home/%u/share
valid users=%s
read only =no
create mask =0664
directory mask = 0775
browseable = no

[printers]
##printers is shared by default therefore don’t need to modify it

……

using sudo chmod g+w to modify the conf file to ensure the created user just now have the

proper permission afterwards

sudo chmod g+w /etc/samba/smb.conf
sudo chgrp adm /etc/samba/smb.conf

4. testing samba
testparm /etc/samba/smb.conf

5. start the smbd daemon
sudo /etc/init.d/samba start

6. Since we want to configure samba using swat, install swat and xinetd.

7. sudo nano /etc/xinetd.d/swat (nano is the same as vi)

8. insert the following text

(http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/SWAT.html#id2681240)
# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
    port    = 901
    socket_type     = stream
    wait    = no
    only_from = localhost
    user    = root
    server  = /usr/sbin/swat
    log_on_failure  += USERID
    disable = no
}

9. running swat.
sudo /etc/init.d/xinetd restart
point your browser to http://localhost:901/
configure your samba via browser

10. Now you are able to find your linux directory in your windows (assume the linux host and

the windows host are connected in a local area network)
Start->My Network places
type the path of the shared linux host, for example \\computer-name-of-linuxhost

Categories: technical notes Tags:
Follow

Get every new post delivered to your Inbox.