Samba

From Hackepedia
Jump to navigationJump to search

To see who is in a specific windows workgroup, assuming the default workgroup name WORKGROUP

# nmblookup WORKGROUP

Install on a Debian based system

$ sudo apt-get install samba

I wanted to install samba without printing and the extra functionality, I solely wanted it for remote directories. My wrokgroup is WORKGROUP and my shared directory which has the proper permissions set is /usr/fileshare:

$ cat /etc/samba/smb.conf
[global]
  workgroup = WORKGROUP
  server string = %h server (FileServer2000)
  dns proxy = no
  log file = /var/log/samba/log.%m
  max log size = 1000
  syslog = 0
  panic action = /usr/share/samba/panic-action %d
  security = user
  encrypt passwords = true
  passdb backend = tdbsam
  obey pam restrictions = yes
  invalid users = root
  passwd program = /usr/bin/passwd %u
  passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
  socket options = TCP_NODELAY
[fileshare]
  comment = A place to store stuff
  path = /usr/fileshare
  read only = no
  public = yes

I then created a user to access the samba share:

$ sudo smbpasswd -a franks
$ sudo /etc/init.d/samba restart

and to be safe I watched the logs as I tested, which are in /var/log/samba. I noticed the following error:

2007/10/25 21:20:56, 0] printing/pcap.c:pcap_cache_reload(159)
 Unable to open printcap file /etc/printcap for read!

this made me realize I (stupidly) can't just remove the printer portion, so I've since added the following to the end of the [global] section of smb.conf:

  printcap name = /dev/null
  load printers = no
  printing = bsd

and restarted samba. All appears well now.