Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
slackware:samba [2006/03/29 19:27] alienslackware:samba [2018/11/21 21:07] (current) – CIFS is used nowadays by smbmount alien
Line 1: Line 1:
- 
-FIXME  ** This article is being worked on **  FIXME 
---------------------------------------------------- 
- 
 ===== File- and printersharing on the local network ===== ===== File- and printersharing on the local network =====
  
Line 38: Line 34:
  
   * This should be in ''/etc/samba/smb.conf'', it defines the password backend Sabma will use (I will not discuss the alternative LDAP backend here, I hope to write another article on that all of it's own): <code>   * This should be in ''/etc/samba/smb.conf'', it defines the password backend Sabma will use (I will not discuss the alternative LDAP backend here, I hope to write another article on that all of it's own): <code>
-    passdb backend = tdbsam guest +    passdb backend = tdbsam:/var/lib/samba/private/passdb.tdb 
-</code> //NOTE//: when you enable //tdbsam// on an already configured and running Samba server, and run ''killall -HUP smbd'' to let it re-load the configuration files, you might have to re-add the 'smbguest' user to Samba, since the default to use is the //smbpasswd// file and not the tdbsam database.\\ So, again run: <code>+</code> //NOTE//: when you enable //tdbsam// on an already configured and running Samba server, and run ''killall -HUP smbd'' to let it re-load the configuration files, you might have to re-add the 'smbguest' user to Samba. \\ In the past, the default to use was the //smbpasswd// file but since Sa,ba 3.4 the tdbsam database became the default.\\ So, again run: <code>
 smbpasswd -a smbguest -d smbpasswd -a smbguest -d
 </code> </code>
Line 122: Line 118:
  
 On a linux client computer, it is the ''smbmount'' command that lets you mount a Samba (or a Windows!) share on the local filesystem. You can run the command manually in a console like this: <code> On a linux client computer, it is the ''smbmount'' command that lets you mount a Samba (or a Windows!) share on the local filesystem. You can run the command manually in a console like this: <code>
-mount -t smbfs //192.168.0.1/public /mnt/samba/bob/public -o rw,uid=0,gid=10,fmask=664,dmask=775 -U <some_special_user>+mount -t cifs //192.168.0.1/public /mnt/samba/bob/public -o rw,uid=0,gid=10,fmask=664,dmask=775 -U <some_special_user>
 </code> which will mount the share called //public// on our server called //bob// which has the IP Address ''192.168.0.1'' in this example. The mountpoint ''/mnt/samba/bob/public'' must of course be created as a directory before. I chose ''/mnt/samba/bob/public'' arbitrarily, I like looking at the mount point's name and be able to guess what it is all about. You are of course free to take another mount point.\\ The command mounts the share as user //<some_special_user>// and it's up to you who that user account is, as long as it has the necessary access rights to the share. If the account has a password associated with it, you will be asked for it.\\ </code> which will mount the share called //public// on our server called //bob// which has the IP Address ''192.168.0.1'' in this example. The mountpoint ''/mnt/samba/bob/public'' must of course be created as a directory before. I chose ''/mnt/samba/bob/public'' arbitrarily, I like looking at the mount point's name and be able to guess what it is all about. You are of course free to take another mount point.\\ The command mounts the share as user //<some_special_user>// and it's up to you who that user account is, as long as it has the necessary access rights to the share. If the account has a password associated with it, you will be asked for it.\\
 The //-o rw,uid=0,gid=10,fmask=664,dmask=775// part means that the remote share will be mounted locally read/write, seemingly owned by user root:wheel (uid=0, gid=10) and with file- and directory masks that make the share's files and directories read/only for non-root, non-[[linux:security#wheel | wheel users]]. Having to type all this in order to mount the share is a tedious effort, so we take the easy way and add the following line to ''/etc/fstab'': <code> The //-o rw,uid=0,gid=10,fmask=664,dmask=775// part means that the remote share will be mounted locally read/write, seemingly owned by user root:wheel (uid=0, gid=10) and with file- and directory masks that make the share's files and directories read/only for non-root, non-[[linux:security#wheel | wheel users]]. Having to type all this in order to mount the share is a tedious effort, so we take the easy way and add the following line to ''/etc/fstab'': <code>
-//192.168.0.1/public /mnt/samba/bob/public  smbfs rw,uid=0,gid=10,fmask=664,dmask=775,credentials=/etc/bob.cred  0 0+//192.168.0.1/public /mnt/samba/bob/public  cifs rw,uid=0,gid=10,fmask=664,dmask=775,credentials=/etc/bob.cred  0 0
 </code> We store the username and password that we need for gaining access to the //public// share, in a file called ''/etc/bob.cred'' which we protect from prying eyes by removing read access for all but the root user: <code> </code> We store the username and password that we need for gaining access to the //public// share, in a file called ''/etc/bob.cred'' which we protect from prying eyes by removing read access for all but the root user: <code>
 chmod 600 /etc/bob.cred chmod 600 /etc/bob.cred
Line 132: Line 128:
 password = <the_secret_word> password = <the_secret_word>
 </code> Having this in our client computer's ''/etc/fstab'' will cause the samba share to be automatically mounted when the computer boots. </code> Having this in our client computer's ''/etc/fstab'' will cause the samba share to be automatically mounted when the computer boots.
 +
 +<note tip>The older "''smbfs''" kernel module is outdated while the "''cifs''" kernel driver is well-maintained and supports higher versions of the SMB protocol than ''smbfs''. Samba implements the CIFS protocol (a dialect of the SMB protocol) and it supports SMB2 and parts of the SMB3 protocol extensions.</note>
 +
 +<note tip>The default CIFS protocol changed from SMB 1.0 to SMB 3.0 in kernel 4.13. If you are running an older Samba server and try to mount its shares on a recent Linux computer this changed default breaks the mounts. In order to force the mount to use SMB 1.0 you need to add "''vers=1.0''" to the mount options</note>
  
 === Mixing protected and passwordless shares === === Mixing protected and passwordless shares ===
 File- and printersharing on the local network ()
SlackDocs