VirtualBox | Strežnik | Odjemalec | NFS | Samba | DHCP
Postavi dva navidezna računalnika - simpleArbiterDhcp in FileServer.
Poskrbi, da bo imenik /srv/nfs/ERLbbBrT na FileServer dostopen prek NFS in prek SMB kot imenik v skupni rabi urania-03. Ime SMB strežnika nastavite na zarptica-32.
SimpleArbiterDhcp naj ima prek NFS pravico pisati po imeniku.
auto eth1
iface eth1 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
INTERFACES="eth1"
authoritative;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.10;
option domain-name-servers 193.2.1.66, 8.8.4.4;
host SimpleArbiter {
hardware ethernet 08:00:27:A2:FB:B4;
fixed-address 192.168.1.180;
}
}
#pravice za SimpleArbiterDhcp
/srv/nfs/ERLbbBrT 192.168.1.180(rw,sync,insecure)
/srv/nfs/ERLbbBrT 192.168.1.0/24(ro,sync,insecure)
In nato še service nfs-kernel-server restart
mkdir /home/urania-03
chown -R root:users /home/urania-03/
chmod -R ug+rwx,o+rx+w /home/urania-03
Uredi nastavitve v /etc/samba/smb.conf:
[global]
workgroup = users
server string = zarptica-32
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = yes
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n
*Retype\snew\s*\spassword:* %n\n
*password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
[homes]
comment = Home Directories
browseable = no
read only = yes
create mask = 0700
directory mask = 0700
valid users = %S
[printers]
comment = ALl Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
[urania-03]
comment = All Users
path = /home/urania-03
users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
Preveri sintakso smb.conf datoteke z ukazom testparam
Potrebno je določiti gesla Samba uporabnikom. Uporabnik mora obstajati tudi kot lokalni uporabnik.
Z ukazom useradd USERNAME --shell /bin/false ustvariš uporabnika z onemogočenim računom in brez domačega direktorija, npr.:
useradd tester --shell /bin/false
Za uporabnika določi Samba geslo:
smbpasswd -a tester
Dodaj uporabnika v skupino.
Odpri /etc/group ter na konec dokumenta dodaj: users:x:1002:tester
mkdir mnt
mkdir mnt/smb
mkdir mnt/nfs
sudo mount 192.168.1.10:/srv/nfs/ERLbbBrT /mnt/nfs
sudo mount -t cifs //192.168.1.10/urania-03 /mnt/smb -o username=tester,password=test,workgroup=users
Sedaj bi moral imeti dostop do deljenih map.