Category Archives: alix

IPv6 on eir

root@voyage:/home/lorcan# more /etc/wide-dhcpv6/dhcp6c.conf
# Default dhpc6c configuration: it assumes the address is autoconfigured using
# router advertisements.
interface ppp0 {
# Identity Association for Prefix Delegation
send ia-pd 0;

# Identity Association for Non-temporary Addresses
# send ia-na 2;

# request domain-name-servers;
# request domain-name;
# script “/etc/wide-dhcpv6/dhcp6c-script”;
};

id-assoc pd 0 {
prefix-interface br0 {
# Assign subnet 1 to eth1
sla-id 1;

# IP address “postfix”. if not set it will use EUI-64 address of the interface.
# Combined with SLA-ID’d prefix to create full IP address of interface.
ifid 1;

# Prefix bits assigned.
# Take the prefix size you’re assigned (/48 or /56) and subtract it from 64.
# In my case I was being assigned a /56, so 64-56=8
sla-len 8;
};
};

 

root@voyage:/home/lorcan# more /etc/radvd.conf
interface br0
{
AdvSendAdvert on;
MaxRtrAdvInterval 30;

prefix ::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
AdvValidLifetime 300;
AdvPreferredLifetime 120;
};
};

 

 

Defaults for dhcpv6 client initscript
# Used by /etc/init.d/wide-dhcpv6-client

# Interfaces on which the client should send DHCPv6 requests and listen to
# answers. If empty, the client is deactivated.
INTERFACES=”ppp0″

 

/etc/ppp/peers/eircom-ipv6

user eircom@eircom.net
pty “/usr/sbin/pppoe -I eth0 -T 80 -m 1452”
noipdefault
usepeerdns
defaultroute
hide-password
lcp-echo-interval 20
lcp-echo-failure 3
connect /bin/true
noauth
persist
mtu 1492
noaccomp
default-asyncmap
plugin rp-pppoe.so eth0
ipparam eircomipv6
+ipv6

root@voyage:/etc/wide-dhcpv6# /etc/init.d/wide-dhcpv6-client status
Status of dhcp6c:
dhcp6c is running.

 

root@voyage:/home/lorcan# /etc/init.d/radvd status
[ ok ] radvd is running.

 

root@voyage:/home/lorcan# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:86.44.5.168 P-t-P:95.44.44.1 Mask:255.255.255.255
inet6 addr: fe80::e4f2:9870:6c07:cc39/10 Scope:Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:446285 errors:0 dropped:0 overruns:0 frame:0
TX packets:648115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:66695078 (63.6 MiB) TX bytes:827447912 (789.1 MiB)

 

 

root@voyage:/home/lorcan# ifconfig br0
br0 Link encap:Ethernet HWaddr 00:0d:b9:29:46:fd
inet addr:192.168.11.254 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::20d:b9ff:fe29:46fd/64 Scope:Link
inet6 addr: 2001:bb6:3a00:1601::1/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:724907 errors:0 dropped:0 overruns:0 frame:0
TX packets:536722 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:838528798 (799.6 MiB) TX bytes:186239015 (177.6 MiB)

 

 

C:\Users\bblab>ipconfig

Windows IP Configuration
Wireless LAN adapter Wireless Network Connection 2:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :

Wireless LAN adapter Wireless Network Connection:

Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:bb6:3a00:1601:70b5:c0b9:8694:128c
Temporary IPv6 Address. . . . . . : 2001:bb6:3a00:1601:14c7:d88b:83b0:20ec
Link-local IPv6 Address . . . . . : fe80::70b5:c0b9:8694:128c%17
IPv4 Address. . . . . . . . . . . : 192.168.11.87
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::20d:b9ff:fe29:46fd%17
192.168.11.254

 

C:\Users\bblab>ping -6 google.com

Pinging google.com [2a00:1450:400c:c02::8a] with 32 bytes of data:
Reply from 2a00:1450:400c:c02::8a: time=35ms
Reply from 2a00:1450:400c:c02::8a: time=39ms
Reply from 2a00:1450:400c:c02::8a: time=39ms
Reply from 2a00:1450:400c:c02::8a: time=34ms

Ping statistics for 2a00:1450:400c:c02::8a:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 34ms, Maximum = 39ms, Average = 36ms

 

root@voyage:/etc/wide-dhcpv6# dhcp6c -fdD ppp0 -c /etc/default/wide-dhcpv6-client
Nov/17/2015 18:02:00: get_duid: extracted an existing DUID from /var/lib/dhcpv6/dhcp6c_duid: 00:01:00:01:1c:14:b9:78:00:0d:b9:29:46:fc
Nov/17/2015 18:02:00: cfdebug_print: <3>comment [# Defaults for dhcpv6 client initscript] (39)
Nov/17/2015 18:02:00: cfdebug_print: <3>comment [# Used by /etc/init.d/wide-dhcpv6-client] (40)
Nov/17/2015 18:02:00: cfdebug_print: <3>comment [# Interfaces on which the client should send DHCPv6 requests and listen to] (74)
Nov/17/2015 18:02:00: cfdebug_print: <3>comment [# answers. If empty, the client is deactivated.] (47)
Nov/17/2015 18:02:00: cfdebug_print: <3>[INTERFACES] (10)
Nov/17/2015 18:02:00: yyerror0: /etc/default/wide-dhcpv6-client 6: syntax error
Nov/17/2015 18:02:00: yyerror0: /etc/default/wide-dhcpv6-client 6: fatal parse failure: exiting (1 errors)
Nov/17/2015 18:02:00: main: failed to parse configuration file
root@voyage:/etc/wide-dhcpv6# dhcp6c -fdD ppp0 -c /etc/wide-dhcpv6/dhcp6c.conf
Nov/17/2015 18:02:25: get_duid: extracted an existing DUID from /var/lib/dhcpv6/dhcp6c_duid: 00:01:00:01:1c:14:b9:78:00:0d:b9:29:46:fc
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Default dhpc6c configuration: it assumes the address is autoconfigured using] (78)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# router advertisements.] (24)
Nov/17/2015 18:02:25: cfdebug_print: <3>[interface] (9)
Nov/17/2015 18:02:25: cfdebug_print: <5>[ppp0] (4)
Nov/17/2015 18:02:25: cfdebug_print: <3>begin of closure [{] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Identity Association for Prefix Delegation] (44)
Nov/17/2015 18:02:25: cfdebug_print: <3>[send] (4)
Nov/17/2015 18:02:25: cfdebug_print: <3>[ia-pd] (5)
Nov/17/2015 18:02:25: cfdebug_print: <3>[0] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Identity Association for Non-temporary Addresses] (50)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# send ia-na 2;] (16)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# request domain-name-servers;] (30)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# request domain-name;] (22)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# script “/etc/wide-dhcpv6/dhcp6c-script”;] (42)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of closure [}] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>[id-assoc] (8)
Nov/17/2015 18:02:25: cfdebug_print: <15>[pd] (2)
Nov/17/2015 18:02:25: cfdebug_print: <15>[0] (1)
Nov/17/2015 18:02:25: cfdebug_print: <15>begin of closure [{] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>[prefix-interface] (16)
Nov/17/2015 18:02:25: cfdebug_print: <5>[br0] (3)
Nov/17/2015 18:02:25: cfdebug_print: <3>begin of closure [{] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Assign subnet 1 to eth1] (25)
Nov/17/2015 18:02:25: cfdebug_print: <3>[sla-id] (6)
Nov/17/2015 18:02:25: cfdebug_print: <3>[1] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# IP address “postfix”. if not set it will use EUI-64 address of the interface.] (79)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Combined with SLA-ID’d prefix to create full IP address of interface.] (71)
Nov/17/2015 18:02:25: cfdebug_print: <3>[ifid] (4)
Nov/17/2015 18:02:25: cfdebug_print: <3>[1] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Prefix bits assigned.] (23)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# Take the prefix size you’re assigned (/48 or /56) and subtract it from 64.] (76)
Nov/17/2015 18:02:25: cfdebug_print: <3>comment [# In my case I was being assigned a /56, so 64-56=8] (51)
Nov/17/2015 18:02:25: cfdebug_print: <3>[sla-len] (7)
Nov/17/2015 18:02:25: cfdebug_print: <3>[8] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of closure [}] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of closure [}] (1)
Nov/17/2015 18:02:25: cfdebug_print: <3>end of sentence [;] (1)
Nov/17/2015 18:02:25: configure_pool: called
Nov/17/2015 18:02:25: clear_poolconf: called
Nov/17/2015 18:02:25: dhcp6_reset_timer: reset a timer on ppp0, state=INIT, timeo=0, retrans=794
Nov/17/2015 18:02:26: client6_send: a new XID (2151ef) is generated
Nov/17/2015 18:02:26: copy_option: set client ID (len 14)
Nov/17/2015 18:02:26: copy_option: set elapsed time (len 2)
Nov/17/2015 18:02:26: copyout_option: set IA_PD
Nov/17/2015 18:02:26: client6_send: send solicit to ff02::1:2%ppp0
Nov/17/2015 18:02:26: dhcp6_reset_timer: reset a timer on ppp0, state=SOLICIT, timeo=0, retrans=1039
Nov/17/2015 18:02:26: client6_recv: receive advertise from fe80::a2f3:e4ff:fe78:8630%ppp0 on ppp0
Nov/17/2015 18:02:26: dhcp6_get_options: get DHCP option server ID, len 10
Nov/17/2015 18:02:26: DUID: 00:03:00:01:a0:f3:e4:78:86:30
Nov/17/2015 18:02:26: dhcp6_get_options: get DHCP option client ID, len 14
Nov/17/2015 18:02:26: DUID: 00:01:00:01:1c:14:b9:78:00:0d:b9:29:46:fc
Nov/17/2015 18:02:26: dhcp6_get_options: get DHCP option IA_PD, len 41
Nov/17/2015 18:02:26: IA_PD: ID=0, T1=21600, T2=36000
Nov/17/2015 18:02:26: copyin_option: get DHCP option IA_PD prefix, len 25
Nov/17/2015 18:02:26: copyin_option: IA_PD prefix: 2001:bb6:3a00:1600::/56 pltime=43200 vltime=43200
Nov/17/2015 18:02:26: dhcp6_get_options: get DHCP option DNS, len 32
Nov/17/2015 18:02:26: client6_recvadvert: server ID: 00:03:00:01:a0:f3:e4:78:86:30, pref=-1
Nov/17/2015 18:02:26: client6_recvadvert: reset timer for ppp0 to 0.981993
Nov/17/2015 18:02:27: select_server: picked a server (ID: 00:03:00:01:a0:f3:e4:78:86:30)
Nov/17/2015 18:02:27: client6_send: a new XID (78ff80) is generated
Nov/17/2015 18:02:27: copy_option: set client ID (len 14)
Nov/17/2015 18:02:27: copy_option: set server ID (len 10)
Nov/17/2015 18:02:27: copy_option: set elapsed time (len 2)
Nov/17/2015 18:02:27: copyout_option: set IA_PD prefix
Nov/17/2015 18:02:27: copyout_option: set IA_PD
Nov/17/2015 18:02:27: client6_send: send request to ff02::1:2%ppp0
Nov/17/2015 18:02:27: dhcp6_reset_timer: reset a timer on ppp0, state=REQUEST, timeo=0, retrans=1090
Nov/17/2015 18:02:27: client6_recv: receive reply from fe80::a2f3:e4ff:fe78:8630%ppp0 on ppp0
Nov/17/2015 18:02:27: dhcp6_get_options: get DHCP option server ID, len 10
Nov/17/2015 18:02:27: DUID: 00:03:00:01:a0:f3:e4:78:86:30
Nov/17/2015 18:02:27: dhcp6_get_options: get DHCP option client ID, len 14
Nov/17/2015 18:02:27: DUID: 00:01:00:01:1c:14:b9:78:00:0d:b9:29:46:fc
Nov/17/2015 18:02:27: dhcp6_get_options: get DHCP option IA_PD, len 41
Nov/17/2015 18:02:27: IA_PD: ID=0, T1=21600, T2=36000
Nov/17/2015 18:02:27: copyin_option: get DHCP option IA_PD prefix, len 25
Nov/17/2015 18:02:27: copyin_option: IA_PD prefix: 2001:bb6:3a00:1600::/56 pltime=43200 vltime=43200
Nov/17/2015 18:02:27: dhcp6_get_options: get DHCP option DNS, len 32
Nov/17/2015 18:02:27: info_printf: nameserver[0] 2001:bb0::1
Nov/17/2015 18:02:27: info_printf: nameserver[1] 2001:bb0::2
Nov/17/2015 18:02:27: get_ia: make an IA: PD-0
Nov/17/2015 18:02:27: update_prefix: create a prefix 2001:bb6:3a00:1600::/56 pltime=43200, vltime=43200
Nov/17/2015 18:02:27: ifaddrconf: failed to add an address on br0: File exists
Nov/17/2015 18:02:27: dhcp6_remove_event: removing an event on ppp0, state=REQUEST
Nov/17/2015 18:02:27: dhcp6_remove_event: removing server (ID: 00:03:00:01:a0:f3:e4:78:86:30)
Nov/17/2015 18:02:27: client6_recvreply: got an expected reply, sleeping.

Advertisements

Monitoring RG using ping script from EC2

This is a script which runs on an Amazon Web Services EC2 instance and pings the RG to see if it is alive. If the ping fails then it sends an e-mail.

[ec2-user@ip-172-31-15-183 ~]$ cat monitor_rgw
#!/bin/bash
# http://www.cyberciti.biz/tips/simple-linux-and-unix-system-monitoring-with-ping-command-and-scripts.html
# -------------------------------------------------------------------------

# add ip / hostname separated by white space
HOSTS="xxxxxxxx.no-ip.org"

# no ping request
COUNT=1

# email report when
SUBJECT="Ping failed"
EMAILID="xxxxxxx@gmail.com"
for myHost in $HOSTS
do
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -eq 0 ]; then
# 100% failed
echo "Subject: $myHost is down at $(date)" | cat - text | /usr/sbin/sendmail -F ec2-user@ami-t2micro2.com -t $EMAILID
fi
done

Crontab is set to run the script every 30 minutes

[ec2-user@ip-172-31-15-183 ~]$ crontab -e
# Monitor remote host every 30 minutes using monitor_rgw
*/30 * * * * /home/ec2-user/monitor_rgw

On the RG itself, a firewall entry is inserted to allow ICMP.

root@voyage:~# iptables -I INPUT 1 -i ppp0 -p icmp

Hard disk

IDE Hard Disk (320GB) is mounted internally using a special bracket. The HDD will store music for the Squeezebox server, so that the router can act as a standalone music server without needing to turn on the PC.

alix-case-1
The HDD is added to the file /etc/fstab

root@voyage:~# cat /etc/fstab
#/dev/hda1       /       ext2    defaults,noatime,rw     0       0
proc            /proc   proc    defaults                0       0
tmpfs                   /tmp    tmpfs   nosuid,nodev                    0               0
#tmpfs           /rw     tmpfs   defaults,size=32M        0       0

### internal hard disk 320GB ###
/dev/hdb1 /media/internal ext3 defaults 1 1

### swap directory for squeezebox ###
/media/internal/swap swap swap defaults 0 0

### external USB disk ###
#/dev/sda4 /media/music ntfs-3g rw,uid=0,gid=0,dmask=0002,fmask=0003 0 0
#/dev/sda3 /media/windows ntfs-3g rw,uid=0,gid=0,dmask=0002,fmask=0003 0 0

The resulting mounts look as follows

root@voyage:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=31112,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=25532k,mode=755)
/dev/disk/by-label/ROOT_FS on / type ext2 (ro,noatime,errors=continue)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=127644k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,relatime,size=127644k)
/dev/hdb1 on /media/internal type ext3 (rw,relatime,errors=continue,barrier=1,data=writeback)
tmpfs on /var/log type tmpfs (rw,nosuid,nodev,relatime,size=127644k)
tmpfs on /var/tmp type tmpfs (rw,nosuid,nodev,relatime,size=127644k)
tmpfs on /var/lib/samba type tmpfs (rw,nosuid,nodev,relatime,size=127644k)
tmpfs on /var/cache/ddclient type tmpfs (rw,nosuid,nodev,relatime,size=127644k)

DNS amplification attack

Using OpenDNS has revealed some unusual activity on my network.
dnsattack2
A lot of DNS requests for some dodgy looking domains.
dnsattack
Looks like a DNS amplification attack, read up on it here.
http://blog.cloudflare.com/deep-inside-a-dns-amplification-ddos-attack

Turns out the DNS resolver is open to the Internet. Fix this in the dnsmasq config by setting it to listen on the LAN interface only.

root@voyage:/etc/network/if-up.d# remountrw
root@voyage:/etc/network/if-up.d# vi /etc/dnsmasq.conf

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.

interface=br0

Restart dnsmasq

root@voyage:/etc/network/if-up.d# /etc/init.d/dnsmasq restart

Check it using this site:

http://www.thinkbroadband.com/tools/dnscheck.html

dnsattack3

Samba

Samba config file looks like this:

root@voyage:~# cat /etc/samba/smb.conf
#
# 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

# 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 = user

# 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 =======================

[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.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# 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

[allusers]

comment = All Users
path = /media/music/
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes

[homes]

comment = Home Directories
browseable = no
valid users = @users
writable = yes
create mask = 0700
directory mask = 0700

[SAMBA]

path=/media/
browseable=yes
writeable=yes
valid users = samba-user
admin users = root

force user  = sharemgr
force group = sharemgr

http://www.unixmen.com/standalone-samba-in-debian-squeeze/

Squeezebox Server

Make the filesystem writeable

remountrw

Install the software

apt-get update
apt-get install logitechmediaserver

Make a swap file

dd if=/dev/zero of=/media/music/swap bs=1024 count=131072
mkswap -f /media/music/swap
swapon /media/music/swap

http://www.tldp.org/HOWTO/Partition/setting_up_swap.html

root@voyage:/var/lib/squeezeboxserver# cat /etc/fstab
#/dev/hda1       /       ext2    defaults,noatime,rw     0       0
proc            /proc   proc    defaults                0       0
tmpfs                   /tmp    tmpfs   nosuid,nodev                    0               0
#tmpfs           /rw     tmpfs   defaults,size=32M        0       0

### internal hard disk 320GB ###
/dev/hdb1 /media/internal ext3 defaults 1 1

### swap directory for squeezebox ###
/media/internal/swap swap swap defaults 0 0

Move the squeezebox cache and prefs files to the hard disk and create symbolic links to them. Otherwise changes to the database or preferences won’t be saved in the compact flash readonly filesystem.

ln -s /media/internal/squeezeboxserver/cache /var/lib/squeezeboxserver/cache
ln -s /media/internal/squeezeboxserver/Plugins /var/lib/squeezeboxserver/Plugins
ln -s /media/internal/squeezeboxserver/prefs /var/lib/squeezeboxserver/prefs

Three symbolic links. Make sure user:group is squeezeboxserver:nogroup for all squeezebox files.

root@voyage:/var/lib/squeezeboxserver# ls -al
total 8
drwxr-xr-x  2 squeezeboxserver nogroup 4096 Dec  6 10:24 .
drwxr-xr-x 22 root             root    4096 Dec  5 18:44 ..
lrwxrwxrwx  1 squeezeboxserver nogroup   38 Jan 11  2001 cache -> /media/internal/squeezeboxserver/cache
lrwxrwxrwx  1 squeezeboxserver nogroup   40 Dec  6 10:24 Plugins -> /media/internal/squeezeboxserver/Plugins
lrwxrwxrwx  1 squeezeboxserver nogroup   38 Jan 11  2001 prefs -> /media/internal/squeezeboxserver/prefs

Configure Youtube plugin (12/11/2015)

Get YouTube API access key from https://console.developers.google.com

Add repository to SB Plugins http://sourceforge.net/projects/lms-youtube/files/dev/repo-sf.xml

Add https line to /usr/share/perl5/Slim/Player/ProtocolHandlers.pm (https://github.com/hechtus/squeezebox-googlemusic/issues/43)
my %protocolHandlers = ( 
    file     => qw(Slim::Player::Protocols::File),
    http     => qw(Slim::Player::Protocols::HTTP),
    https    => qw(Slim::Player::Protocols::HTTP),
    icy      => qw(Slim::Player::Protocols::HTTP),
    mms      => qw(Slim::Player::Protocols::MMS),
    spdr     => qw(Slim::Player::Protocols::SqueezePlayDirect),
    playlist => 0,
    db       => 1,
);