07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1 5<br />

Specifies the character set and encoding used for file names under Linux. The default<br />

value is UTF8 (Unicode).<br />

Adding Users Each Samba user needs an account on the server; the Unix accounts must be<br />

created first, then the user needs to be registered in Samba's database. The Unix step is done<br />

quite normally (using adduser for instance).<br />

Adding an existing user to the Samba database is a matter of running the smbpasswd -a user<br />

command; this command asks for the password interactively.<br />

A user can be deleted with the smbpasswd -x user command. A Samba account can also be<br />

temporarily disabled (with smbpasswd -d user) and re-enabled later (with smbpasswd -e<br />

user).<br />

Switching to Domain Controller This section documents how the Falcot administrators went<br />

even further, by turning the Samba server into a domain controller providing roaming profiles<br />

(which allow users to find their desktop no matter what machine they connect to).<br />

They first added a few extra directives in the [global] section of the configuration file:<br />

domain logons = yes<br />

preferred master = yes<br />

logon path = \\%L\profiles\%U<br />

logon script = scripts/logon.bat 1 3<br />

11<br />

12<br />

1 1<br />

Enables the domain controller functionality.<br />

1 2<br />

Specifies the location of the users' home directories. These are stored on a dedicated<br />

share, which allows enabling specific options (in particular, profile acls, a requirement<br />

for compatibility with Windows 2000, XP and Vista).<br />

1 3<br />

Specifies the batch (non-interactive) script that is to be run on the client Windows machine<br />

every time a session is opened. In this case, /var/lib/samba/netlogon/scripts/<br />

logon.bat. The script needs to be in DOS format, where the lines are separated by a<br />

carriage-return character and a line-feed character; if the file was created on Linux, running<br />

unix2dos will convert it.<br />

The commands used most widely in these scripts allow the automatic creation of network<br />

drives and synchronizing the system time.<br />

net time \\ARRAKIS /set /yes<br />

net use H: /home<br />

net use U: \\ARRAKIS\utils<br />

Example 11.28<br />

The logon.bat file<br />

Chapter 11 — Network Services: Postfix, Apache, NFS, Samba, Squid, LDAP<br />

283

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!