Hier een cheatsheet hoe CUPS, Samba en SWAT te installeren. CUPS kan je trouwens na deze install *wel* via de webinterface beheren, iets wat de kale install vanuit synaptic niet toestaat.
Voor CUPS moet je root een password gegeven hebben (sudo passwd root). Samba gebruikers voeg je als volgt toe:
useradd [gebruiker] -m -G users
smbpasswd -a [gebruiker]
De gebruikte repositories: main, universe en multiverse
Succes!
CUPS:
-----
apt-get install cupsys cupsys-client cupsys-bsd cupsys-driver-gimpprint
apt-get install hp-ppd hplip hpijs foomatic-db foomatic-db-engine foomatic-db-hpijs foomatic-filters-ppds
adduser cupsys shadow
adduser root lpadmin
vi /etc/cups/cups.d/browse.conf
Browsing on
vi /etc/cups/cups.d/ports.conf
Listen localhost:631
Listen 127.0.0.1:631
Listen je server IP hier:631
Listen /var/run/cups/cups.sock
vi /etc/cups/cupsd.conf
# Restrict access to the server...
Order allow,deny
Allow localhost
Allow je.netwerk.IP.*
# Restrict access to the admin pages...
Order allow,deny
Allow localhost
Allow je.netwerk.IP.*
# Restrict access to configuration files...
AuthType Basic
Require user @SYSTEM
Order allow,deny
Allow localhost
Allow je.netwerk.IP.*
/etc/init.d/cupsys restart
Samba:
------
apt-get install samba samba-common samba-doc libcupsys2-gnutls10 libkrb53 winbind smbclient hplip foomatic-db foomatic-db-hpijs foomatic-db-engine hpijs hplip-data hplip-ppds
vi /etc/samba/smb.conf
[global]
workgroup = MYWORKGROUP
netbios name = servernaam
server string = %h server (Samba, Ubuntu)
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
# Set CUPS for printing
printcap name = CUPS
printing = CUPS
# Default logon
logon drive = H:
logon script = scripts/logon.bat
logon path = \\server1\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
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
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
passwd chat debug = yes
unix password sync = yes
# set the loglevel
log level = 3
[homes]
comment = Home
valid users = %S
read only = no
browsable = no
[printers]
comment = All Printers
path = /var/spool/samba
printable = yes
guest ok = yes
browsable = no
[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
mkdir /home/samba
mkdir /home/samba/netlogon
mkdir /home/samba/profiles
mkdir /var/spool/samba
chmod 777 /var/spool/samba/
chown -R root:users /home/samba/
chmod -R 771 /home/samba/
/etc/init.d/samba restart
vi /etc/nsswitch.conf
hosts: files wins dns
echo "root = Administrator" > /etc/samba/smbusers
net groupmap modify ntgroup="Domain Admins" unixgroup=root
net groupmap modify ntgroup="Domain Users" unixgroup=users
net groupmap modify ntgroup="Domain Guests" unixgroup=nogroup
SWAT:
-----
apt-get install swat xinetd
vi /etc/xinetd.d/swat
# description: SAMBA SWAT
service swat
{
disable = no
socket_type = stream
protocol = tcp
#should use a more limited user here
user = root
wait = no
server = /usr/sbin/swat
}
dpkg-reconfigure xinetd