Which defines the account to use when authenticating guests. Don’t forget to create this user using
# smbpasswd -an nobody
This will create the user with no password.
Now we have a perfectly valid Samba setup with a public share, but every time a user wants to access this share as a guest, he will have to do so by logging in as “nobody”. To complete our setup and imitate Windows behaviour, add the following line to the smb.conf global section:
This maps any unknown username to the specified guest user, so login always succeeds. Remember, this will only work for unknown usernames. If an unhappy user called “pete” tries to login while there already exists a pete on the server with a different password, he will be denied access. This is normal behaviour when imitating Windows, so we’ll just have to live with that.
Now, I did run into a permissions issue when accessing the shares from a win7 box on the network. I could access, but not move anything from win7 > Ubuntu server. I simply changed the permissions on the shares in /media by right clicking & changing permissions for anonymous r/w access.
Oops- I just realized something. I should have just changed the ownership of the share to ‘nobody’, that way anyone logged in as ‘nobody’ has full rights.
Here is my complete smb.conf file :
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)
# Windows Internet Name Serving Support Section:
# WINS Support – Tells the NMBD component of Samba to enable its WINS Server
# wins support = no
# WINS Server – Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z
# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no
# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast
#### Networking ####
# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0
# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
max log size = 1000
# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = share
guest account = nobody
# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam
obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes
# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes
# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user
########## Domains ###########
# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U
# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd
# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser –quiet –disabled-password –gecos "" %u
# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup –force-badname %g
########## Printing ##########
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes
# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap
# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups
############ Misc ############
# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m
# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY
# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &
# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
# domain master = auto
# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash
# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes
# Setup usershare options to enable non-root users to share folders
# with the net usershare command.
# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100
# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home director as \\server\username
;[homes]
; comment = Home Directories
; browseable = no
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# The following parameter makes sure that only "username" can connect
#
# This might need tweaking when using external authentication schemes
; valid users = %S
# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes
# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom
#add kevins user shares from areca raidserver
[diag1]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt1
[photo2]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt2
[webdev3]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt3
[video4]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt4
[ftp5]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt5
[users6]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt6
[torrent7]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt7
[backup8]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt8
[music9]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt9
[projects10]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt10
[movies11]
available = yes
browsable = yes
writable = yes
public = yes
guest ok = yes
path = /media/medslt11
Speed up Samba network access
Without any adjustments I transferred a huge volume of files of varying sizes to check throughput. When the transfer first kicks it transfers at approx 13 MB/Sec, tapering off to 6.15 MB/sec after buffers saturate. This is pretty poor performance so lets see what we can do.
First, lets try to add following to [global] section of smb.conf (should get approx 200% better throughput)
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
Very little difference 
using socket options = TCP_NODELAY
Very little difference 
Try Using:
read size = 65536
read prediction = true
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
Very little difference 
Not sure what to do at this point- I’ll come back to this one later.
Install Logitech Media Server in Ubuntu 12.04 (Precise Pangolin)
First, an out-of-box install of the Logitech Media Server (LMS) requires the following additional packages be installed:
I went to mysqueezebox.com/download and downloaded the latest (v 7.7.2). Select the Ubuntu / Debian package and download. Click to start the install, and it will guide you through the base install. We have a few more details to take care of before we finish:
First we need a few perl packages:
sudo apt-get install libjson-xs-perl libev-perl libyaml-libyaml-perl
Lastly, you need a package that has been deprecated in v 12.04. If you check out the Ubuntu bug report on it, LMS isn't the only project still trying to use the old Perl module. Someone has kindly provided a package that will work for 12.04 however that fixes the problem.
Download
this package which is also linked inside the above bug report. After it's download just double-click it and let the package manager install it. I did not put that package together and cannot really vouch for it, but I'm using it myself. Note this is for the AMD64 only.
libdigest-sha1-perl is the package you need.
Unfortunately, if you are running 32bit, you cant use the amd64 deb.
After a bit of struggling I found
Libdigest-sha1-perl_2.13-2build2_i386.deb on launchpad.net- Use this for a 32bit Ubuntu installation.
Use the software center in ubuntu to install.
Start the server at arecaserver1:9000
If you navigate to the details, the web interface will give you a great amount of info:
Logitech Media Server Status
Logitech Media Server Version: 7.7.1 – r33735 @ Mon Nov 28 15:45:08 PST 2011
Hostname: arecaserver1
Server IP Address: 192.168.1.68
Server HTTP Port Number: 9000
Operating system: Debian – EN – utf8
Platform Architecture: i686-linux
Perl Version: 5.14.2 – i686-linux-gnu-thread-multi-64int
Database Version: DBD::SQLite 1.34_01 (sqlite 3.7.7.1)
Total Players Recognized: 1
Library Statistics
Total Images: 0
Total Videos: 0
Total Tracks: 400
Total Albums: 38
Total Artists: 5
Total Genres: 5
Total Playing Time: 29:51:05
Media Scan Details
Discovering files/directories: /media/slot9/areca1_9_mus/MP3 music (5917 of 5917) Complete 00:00:03
Pre-caching Artwork (11 of 11) Complete 00:00:01
Scanning new music files: /media/slot9/areca1_9_mus/MP3 music (3410 of 4869) Running 00:10:21
/media/slot9/areca1_9_mus/MP3 music/Mike Oldfield/The Best of Mike Oldfield- Elements/In Dulci Jubilo.mp3
The server has finished scanning your media library.
Total Time: 00:10:25
Player Information
Information on all identified devices connected to Logitech Media Server
bathsqueez
Player Model: Squeezebox Radio
Firmware: 7.7.1-r9557
Player IP Address: 192.168.1.90
Player MAC Address: 00:04:20:27:36:7a
Wireless Signal Strength: 83%
Folders
Cache Folder /var/lib/squeezeboxserver/cache
Preferences Folder /var/lib/squeezeboxserver/prefs
Plugin Folders /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins, /usr/sbin/Plugins, /usr/share/squeezeboxserver/Plugins
Logitech Media Server Log File
Scanner Log File
Install VSFTPD FTP Server in Ubuntu 12.04 (Precise Pangolin)-FAIL!
sudo apt-get install vsftpd
Edit the config file
The vsftpd.conf file contains a large number of configuratrions arguments . If you want people with local user accounts on the FTP server to be able to connect via FTP (you usually do), you will need to change this directive:
local_enable=YES
write_enable=YES
anonymous_enable=NO
Save and exit
Restart vsftpd
sudo service vsftpd restart
I can now log locally into the server using ubuntu credentials which takes me to the root directory of /home/kevin after I log in.
I also can log in locally in anonymous mode with root access
If you want to give writing rights to users for some extra directories . You need to set chmod a+w /directory
I punched a pinhole through my firewall at 70.138.X.X:21 This is internet accessible, not fiddling with any DNS resolution right now. I really want to jail the ftp users to a specific ftp directory as follows:
You have to modify the startup call for vsftpd.
Edit the /etc/vsftpd.conf file customization section to add:
User_config_dir=/etc/vsftpd/users
The user_config_dir argument will tell the server to look for a configuration file named kevin in the directory /etc/vsftpd/users/ if the user kevin logs in.
We create a file named kevin (local user) in the folder /etc/vsftpd/users which contains:
Local_root=/media/medslt5/sdf1folder/kevin
This instructs the server to use the local root directive =/media/medslt5/sdf1folder/kevin when kevin logs in.
This works but I need to jail kevin at media/medslt5/sdf1folder/kevinftp so he cant back up into an unsecure area.
I just cannot get vsftpd and ubuntu 12.04 to play nicely. I’m declaring this a FAIL, and moving on to proftpd option.
sudo apt-get purge vsftpd
Install Gadmin-ProFTPd Server in Ubuntu 12.04 (Precise Pangolin)
sudo apt-get install gadmin-proftpd
I set the system up with several users that are chrooted to /media/medslt5/sdf1folder/[username]. The gadmin interface makes it all pretty painless !
There is a bug in ProFTPd when communicating with Filezilla client or others that utilize the MLSD command. This causes the server to kick the user out when listing the directory contents with MLSD. There is a bug that can be corrected by commenting out the lines:
#DirFakeUser off nobody
#DirFakeGroup off nobody
In the proftpd.conf file. The contents of my proftpd.conf are:
ModulePath /usr/lib/proftpd
LoadModule mod_ctrls_admin.c
LoadModule mod_tls.c
LoadModule mod_radius.c
LoadModule mod_quotatab.c
LoadModule mod_quotatab_file.c
LoadModule mod_quotatab_radius.c
LoadModule mod_wrap.c
LoadModule mod_rewrite.c
LoadModule mod_load.c
LoadModule mod_ban.c
LoadModule mod_wrap2.c
LoadModule mod_wrap2_file.c
LoadModule mod_dynmasq.c
LoadModule mod_exec.c
LoadModule mod_shaper.c
LoadModule mod_ratio.c
LoadModule mod_site_misc.c
LoadModule mod_sftp.c
LoadModule mod_sftp_pam.c
LoadModule mod_facl.c
LoadModule mod_unique_id.c
LoadModule mod_copy.c
LoadModule mod_deflate.c
LoadModule mod_ifversion.c
LoadModule mod_tls_memcache.c
LoadModule mod_ifsession.c
ServerType standalone
DefaultServer on
Umask 022
ServerName "192.168.1.68"
ServerIdent on "Arecaserver1"
ServerAdmin email@example.org
IdentLookups off
UseReverseDNS off
Port 21
PassivePorts 49152 65534
#MasqueradeAddress None
TimesGMT off
MaxInstances 30
MaxLoginAttempts 3
TimeoutLogin 300
TimeoutNoTransfer 120
TimeoutIdle 120
DisplayLogin welcome.msg
DisplayChdir .message
User nobody
Group nobody
#DirFakeUser off nobody
#DirFakeGroup off nobody
DefaultTransferMode binary
AllowForeignAddress off
AllowRetrieveRestart on
AllowStoreRestart on
DeleteAbortedStores off
TransferRate RETR 220
TransferRate STOR 250
TransferRate STOU 250
TransferRate APPE 250
SystemLog /var/log/secure
RequireValidShell off
<IfModule mod_tls.c>
TLSEngine off
TLSRequired off
TLSVerifyClient off
TLSProtocol SSLv23
TLSLog /var/log/proftpd_tls.log
TLSRSACertificateFile /etc/gadmin-proftpd/certs/cert.pem
TLSRSACertificateKeyFile /etc/gadmin-proftpd/certs/key.pem
TLSCACertificateFile /etc/gadmin-proftpd/certs/cacert.pem
TLSRenegotiate required off
TLSOptions AllowClientRenegotiation
</IfModule>
<IfModule mod_ratio.c>
Ratios off
SaveRatios off
RatioFile "/restricted/proftpd_ratios"
RatioTempFile "/restricted/proftpd_ratios_temp"
CwdRatioMsg "Please upload first!"
FileRatioErrMsg "FileRatio limit exceeded, upload something first…"
ByteRatioErrMsg "ByteRatio limit exceeded, upload something first…"
LeechRatioMsg "Your ratio is unlimited."
</IfModule>
<Limit LOGIN>
AllowUser bonnieftp
AllowUser kevinftp
AllowUser kbftp
DenyALL
</Limit>
<Anonymous /media/medslt5/sdf1folder/bonnieftp>
User bonnieftp
Group bonnieftp
AnonRequirePassword on
MaxClients 3 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
<Limit LOGIN>
Allow from all
Deny from all
</Limit>
AllowOverwrite off
<Limit LIST NLST STOR STOU RETR RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit APPE SITE SITE_CHMOD SITE_CHGRP MTDM >
DenyAll
</Limit>
</Anonymous>
<Anonymous /media/medslt5/sdf1folder/kevinftp>
User kevinftp
Group kevinftp
AnonRequirePassword on
MaxClients 3 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
<Limit LOGIN>
Allow from all
Deny from all
</Limit>
AllowOverwrite off
<Limit LIST NLST STOR STOU RETR DELE MKD XMKD SITE_MKDIR PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit APPE RNFR RNTO RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM >
DenyAll
</Limit>
</Anonymous>
<Anonymous /media/medslt5/sdf1folder/kbftp>
User kbftp
Group kbftp
AnonRequirePassword on
MaxClients 10 "The server is full, hosting %m users"
DisplayLogin welcome.msg
DisplayChdir .msg
<Limit LOGIN>
Allow from All
Deny from all
</Limit>
AllowOverwrite on
<Limit LIST NLST STOR STOU APPE RETR RNFR RNTO DELE MKD XMKD SITE_MKDIR RMD XRMD SITE_RMDIR SITE SITE_CHMOD SITE_CHGRP MTDM PWD XPWD SIZE STAT CWD XCWD CDUP XCUP >
AllowAll
</Limit>
<Limit NOTHING >
DenyAll
</Limit>
</Anonymous>
I’ll add some more security and anon access later, but runs fine pretty much out of the box with the exception of the directives issue.
Recent Comments