Difference between revisions of "Samba/how-to"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(extracted some stuff to subpages)
 
Line 4: Line 4:
 
* {{l/sub|name resolution}}: automatic resolution of [[Network Neighborhood]] names
 
* {{l/sub|name resolution}}: automatic resolution of [[Network Neighborhood]] names
 
===Debug connection/access issues===
 
===Debug connection/access issues===
Samba maintains activity logs in /var/log/samba/. There seem to be two logs, log.nmbd and log.smbd; log.smbd generally has information about connections and access, while log.nmbd has more to to with network-name resolution. The nature of the log files is configurable somewhat through [[smb.conf]] (see '''log level''', among others). Use '''[[tail (command)|tail]] -f /var/log/samba/log.smbd''' (for example) to monitor a logfile in real-time.
+
Samba maintains activity logs in /var/log/samba/. There seem to be two logs, log.nmbd and log.smbd; log.smbd generally has information about connections and access, while log.nmbd has more to to with network-name resolution. The nature of the log files is configurable somewhat through [[smb.conf]] (see '''log level''', among others). Use '''{{l/cmd|tail}} -f /var/log/samba/log.smbd''' (for example) to monitor a logfile in real-time.
  
 
===Mount Remote Samba Shares on Local Filesystem===
 
===Mount Remote Samba Shares on Local Filesystem===
Line 12: Line 12:
 
* Long version, which will let you know if mount.cifs is not installed:
 
* Long version, which will let you know if mount.cifs is not installed:
 
  mount.cifs //beaker/MY\ DOCUMENTS /mnt/machines/beaker/My\ Documents --verbose -o sec=lanman,servername=BEAKER,guest
 
  mount.cifs //beaker/MY\ DOCUMENTS /mnt/machines/beaker/My\ Documents --verbose -o sec=lanman,servername=BEAKER,guest
 +
==Notes==
 +
''as explained by user adaptr on #samba on freenode:''
 +
<blockquote>
 +
Each machine that participates in a netbios/smb network (or workgroup) is both client and server - it takes services and advertises them. Any machine at least advertises the <u>MACHINE</u> service &ndash; just its own netbios machine name with a specific SMB service type &ndash; so even if it's only trying to browse or auth to an SMB server, that client offers its own service data to what is known as the [[Samba/master browser|master browser]].
 +
</blockquote>
 +
''user kukks adds:''
 +
<blockquote>
 +
To get more debug info from the cifs kernel module, use the following as root:
 +
echo 7 > /proc/fs/cifs/cifsFYI
 +
This will instruct cifs vfs to write more debug stuff to the kernel log.
 +
</blockquote>
 +
===can't browse into folders===
 +
The following lines in [[smb.conf]] fix a common problem where you can see folders underneath a share but can't browse into them (this may only be a problem if they are symbolic links):
 +
# 2010-04-20 makes wide links work again
 +
  # allows samba to show/include symbolic-linked folders and files:
 +
  follow symlinks = yes
 +
  # allows links to targets not within the shared folder
 +
  wide links = yes
 +
  # disable option incompatible with wide links
 +
  unix extensions  = no

Revision as of 15:23, 16 September 2024

Pages

Debug connection/access issues

Samba maintains activity logs in /var/log/samba/. There seem to be two logs, log.nmbd and log.smbd; log.smbd generally has information about connections and access, while log.nmbd has more to to with network-name resolution. The nature of the log files is configurable somewhat through smb.conf (see log level, among others). Use tail -f /var/log/samba/log.smbd (for example) to monitor a logfile in real-time.

Mount Remote Samba Shares on Local Filesystem

Where the share to be mounted is "//beaker/My Documents", and assuming beaker is a Win98 machine using share-mode security with no password:

  • Short version --
mount -t cifs //BEAKER/MY\ DOCUMENTS /mnt/machines/beaker/My\ Documents -o sec=lanman,servername=BEAKER
  • Long version, which will let you know if mount.cifs is not installed:
mount.cifs //beaker/MY\ DOCUMENTS /mnt/machines/beaker/My\ Documents --verbose -o sec=lanman,servername=BEAKER,guest

Notes

as explained by user adaptr on #samba on freenode:

Each machine that participates in a netbios/smb network (or workgroup) is both client and server - it takes services and advertises them. Any machine at least advertises the MACHINE service – just its own netbios machine name with a specific SMB service type – so even if it's only trying to browse or auth to an SMB server, that client offers its own service data to what is known as the master browser.

user kukks adds:

To get more debug info from the cifs kernel module, use the following as root: echo 7 > /proc/fs/cifs/cifsFYI This will instruct cifs vfs to write more debug stuff to the kernel log.

can't browse into folders

The following lines in smb.conf fix a common problem where you can see folders underneath a share but can't browse into them (this may only be a problem if they are symbolic links):

# 2010-04-20 makes wide links work again
 # allows samba to show/include symbolic-linked folders and files:
 follow symlinks = yes
 # allows links to targets not within the shared folder
 wide links = yes
 # disable option incompatible with wide links
 unix extensions  = no