/etc/network/interfaces |
/etc/resolv.conf |
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.220 netmask 255.255.255.0 gateway 192.168.1.1 |
domain linux800.be search linux800.be nameserver 192.168.1.201 |
/etc/hostname |
/etc/hosts |
pc00.linux800.be |
127.0.0.1 localhost 192.168.1.220 pc00 pc00.linux800.be 192.168.1.241 xp1 192.168.1.242 xp2 192.168.1.243 xp3 192.168.1.244 xp4 |
passwd: compat group: compat shadow: compat hosts: files wins dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis |
Pas de /etc/samba/smb.conf aan als volgt:
[global] workgroup = linux800 netbios name = pc00 server string = %h server (Samba %v, Ubuntu) log file = /var/log/samba/log.%m log level = 3 max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d ;[]domain controller settings: passdb backend = tdbsam security = user username map = /etc/samba/smbusers name resolve order = wins bcast hosts domain logons = yes preferred master = yes wins support = yes # Default logon logon drive = H: logon script = scripts/logon.bat logon path = \\pc00\profile\%U # Useradd scripts add user script = /usr/sbin/useradd -m %u delete user script = /usr/sbin/userdel -r %u add group script = /usr/sbin/groupadd %g delete group script = /usr/sbin/groupdel %g add user to group script = /usr/sbin/usermod -G %g %u ; volgende twee regels in je config op 1 regel !!! add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u idmap uid = 15000-20000 idmap gid = 15000-20000 # sync smb passwords with linux passwords passwd program = /usr/bin/passwd %u ; volgende twee regels in je config op 1 regel !!! passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n . passwd chat debug = yes unix password sync = yes [netlogon] comment = Network Logon Service path = /home/samba/netlogon admin users = Administrator valid users = %U read only = no [profile] comment = User profiles path = /home/samba/profiles valid users = %U create mode = 0600 directory mode = 0700 writable = yes browsable = no ;reeds bestaande shares als stand-alone server [homes] read only = no valid users = %S browseable = no [isos] read only = yes path = /vboxdeb6/isos browseable = yes [public] read only = no path = /home/public browseable = yes |
# smbpasswd -a root
# echo "root = Administrator" > /etc/samba/smbusers
We maken nu de directorystructuur aan waarin onze users kunnen inloggen en data plaatsen:
# mkdir -p /home/samba/netlogon
# mkdir /home/samba/profiles
# mkdir /var/spool/samba
mkdir: cannot create directory `/var/spool/samba/': File exists
Soms bestaat deze directory al.
We gaan vervolgens verder met het instellen van de permissions en ownerships:
# chown -R root:users /home/samba/
# chmod -R 777 /home/samba/
Herstart SAMBA met het volgende commando:
# /etc/init.d/samba restart
# net groupmap add ntgroup="Domain Admins" unixgroup="root" type=domain -U root
# net groupmap add ntgroup="Domain Users" unixgroup="users" type=domain -U root
# net groupmap add ntgroup="Domain Guests" unixgroup="nogroup" type=domain -U root
vim /root/bin/samba-user |
#!/bin/bash # samba-user: script to add samba-users in domain controller # parameter $1 = username $2 = password gebruiker="noname" if [ -n "$1" ]; then gebruiker=$1 else echo "Usage: samba-user <username> [<password>]" echo no username given. exit fi if [ -n "$2" ]; then paswoord=$2 else paswoord="sdf12345" fi net rpc user add $gebruiker -U root net rpc user password $gebruiker "$paswoord" -U root smbpasswd -e $gebruiker |
Mensen die de oefening http://linux800.be/lx-svs-info-samba-in-AD "samba in active directory" hebben gemaakt, moeten hun server terug in oorspronkelijk toestand brengen: winbind desinstalleren, /etc/nsswitch.conf in zijn originele toestand terugbrengen, en smb.conf voledig leegmaken.
# rm -r /etc/rc?.d/S??winbind*
# /etc/init.d/winbind stop
# mv smb.conf smb.conf.ads
# touch smb.conf
# vim /etc/nsswitch.conf
passwd: compat |