Difference between revisions of "Samba"

From LinuxIntro
Jump to: navigation, search
(Mounting a network drive)
(Mounting a network drive)
Line 4: Line 4:
 
You are on a Linux computer and want to mount a Windows computer's shared drive. To do this, [[open a console]] and type
 
You are on a Linux computer and want to mount a Windows computer's shared drive. To do this, [[open a console]] and type
 
  mount -o username=''user'',password=''password'' //''computer''/''share'' ''/mountpoint''
 
  mount -o username=''user'',password=''password'' //''computer''/''share'' ''/mountpoint''
Here you replace ''user'' by your user name, ''password'' by your password, ''computer'' by your computer's name, ''share'' by your share's name and ''/mountpoint'' by your mountpoint, e.g. /mnt/samba. Note that your mountpoint has to be an existing directory.
+
Here you replace ''user'' by your user name, ''password'' by your password, ''computer'' by your computer's name, ''share'' by your share's name and ''/mountpoint'' by your mountpoint, e.g. /mnt/samba. Note that your mountpoint has to be an existing directory. This example has been tested with SUSE Linux Enterprise Server 10 and Windows Enterprise Server 2008 but should work same or similar with any distribution.
  
 
= Providing a network drive =
 
= Providing a network drive =

Revision as of 13:56, 28 May 2009

Samba allows you to access network drives on Windows computers from your Linux computer and to provide network drives for Windows computer on your Linux computer. If your computer accesses a network drive, you are using the Samba client. If you provide a network drive on your computer, you are running the Samba server.

Contents

Mounting a network drive

You are on a Linux computer and want to mount a Windows computer's shared drive. To do this, open a console and type

mount -o username=user,password=password //computer/share /mountpoint

Here you replace user by your user name, password by your password, computer by your computer's name, share by your share's name and /mountpoint by your mountpoint, e.g. /mnt/samba. Note that your mountpoint has to be an existing directory. This example has been tested with SUSE Linux Enterprise Server 10 and Windows Enterprise Server 2008 but should work same or similar with any distribution.

Providing a network drive

In this chapter we discuss how to provide a network drive that is accessible for everyone in the network. Make sure /etc/samba/smb.conf contains the following:

[global]
	security = share

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

Then do a

/etc/init.d/smb restart

Then mount the tmp share

mount //localhost/tmp /mnt/smb

TroubleShooting

If you get

mount error 13 = Permission denied

You may have to add the samba user for the mount. Like this:

smbpasswd -a root

See also