Difference between revisions of "Samba - mounting share from linux"

From thelinuxwiki
Jump to: navigation, search
(Listing samba / cifs shares)
Line 7: Line 7:
 
== Listing samba / cifs shares ==
 
== Listing samba / cifs shares ==
  
smbclient --list=192.168.167.8
+
 
 +
# smbclient -L xpmachine
 +
Enter root's password:
 +
Domain=[xpmachine] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
 +
 
 +
        Sharename      Type      Comment
 +
        ---------      ----      -------
 +
        E$              Disk      Default share
 +
        IPC$            IPC      Remote IPC
 +
        cdrom          Disk     
 +
        data            Disk     
 +
        ADMIN$          Disk      Remote Admin
 +
        C$              Disk      Default share
 +
Domain=[xpmachine] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
 +
 
 +
        Server              Comment
 +
        ---------            -------
 +
 
 +
        Workgroup            Master
 +
        ---------            -------
 +
 
  
 
[[Mount command syntax]]
 
[[Mount command syntax]]

Revision as of 17:19, 24 September 2013

Contents

required packages

on gentoo... look for something similar in your distro's repo

net-fs/cifs-utils
dev-perl/Filesys-SmbClient

Listing samba / cifs shares

  1. smbclient -L xpmachine

Enter root's password: Domain=[xpmachine] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

       Sharename       Type      Comment
       ---------       ----      -------
       E$              Disk      Default share
       IPC$            IPC       Remote IPC
       cdrom           Disk      
       data            Disk      
       ADMIN$          Disk      Remote Admin
       C$              Disk      Default share

Domain=[xpmachine] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

       Server               Comment
       ---------            -------
       Workgroup            Master
       ---------            -------


Mount command syntax

newer mount command (smbfs depricated)

mount -t cifs //server/E$ /mnt/test -o username=gagazote/mydomain,password=hackth1s

required package for cifs file type on debian: cifs-utils

sudo apt-get install cifs-utils

This might require the mount-cifs package


old mount command

mount -t smbfs //servername/sharename /mountdirectory -o username=mywindowsusername,password=mywindowspassword


samba users

/etc/samba/smb.conf Uncomment the security line *** this will require a local user account for each smbuser ***

security = user
username map = /etc/samba/smbusers

make local user account, no hoee dir or local passwd needs to be set

useradd smbuser

add user to /etc/samba/smbusers

<localusername> = “<samba username>”.

example

smbuser = smbuser