[root@centos5 ~]# rpm -qa | grep samba system-config-samba-1.2.41-5.el5 samba-common-3.0.33-3.15.el5_4.1 samba-client-3.0.33-3.15.el5_4.1 samba-3.0.33-3.15.el5_4.1 |
[root@centos5 ~]# service smb status smbd is stopped nmbd is stopped |
[root@centos5 ~]# cp /etc/samba/smb.conf /root/conf.orig/ |
[root@centos5 ~]# mkdir /home/tanari [root@centos5 ~]# mkdir -p /megoszt/inst/munkaallomasra [root@centos5 ~]# mkdir /megoszt/inst/kep [root@centos5 ~]# mkdir -p /megoszt/oktat/oktatif |
[root@centos5 ~]# chown pf:tanar /home/tanari [root@centos5 ~]# chmod 770 /home/tanari [root@centos5 ~]# chown -R pf:pf /megoszt/inst [root@centos5 ~]# chown -R pf:pf /megoszt/oktat |
[root@centos5 ~]# cat /etc/samba/smb.conf | sed '/^#/d; /^;/d; /^ *$/d; /^. *#/d;' |
[global] workgroup = SULI server string = File Server netbios name = HUBA interfaces = lo eth1 192.168.55.0/24 hosts allow = 127. 192.168.55. map to guest = bad user security = user passdb backend = tdbsam wins support = yes load printers = yes load printers = no cups options = raw [homes] comment = Home Directories path = %H/Dokumentumok browseable = no writable = yes create mask = 0644 directory mask =0755 valid users = %S [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes [admhome] comment = Csak admin path = /home valid users = pf hrobi public = no writable = no share modes = no browseable = no [inst] comment = Csak olvas path = /megoszt/inst guest ok = yes writable = no share modes = no [oktat] comment = oktatasi anyagok inditofajljai path = /megoszt/oktat/oktatif guest ok = yes writable = no share modes = no [tanari] comment = tanaroknak irhato path = /home/tanari valid users = @tanar public = no writable = yes share modes = no browseable = no |
[root@centos5 ~]# testparm Load smb config files from /etc/samba/smb.conf Processing section "[homes]" Processing section "[printers]" Processing section "[admhome]" Processing section "[inst]" Processing section "[oktat]" Processing section "[tanari]" Loaded services file OK. Server role: ROLE_STANDALONE Press enter to see a dump of your service definitions [global] workgroup = SULI netbios name = HUBA server string = File Server interfaces = lo, eth1, 192.168.55.0/24 map to guest = Bad User passdb backend = tdbsam load printers = No wins support = Yes hosts allow = 127., 192.168.55. cups options = raw [homes] ... |
[root@centos5 ~]# service smb start [root@centos5 ~]# chkconfig --levels 235 smb on |
c:\net view c:\net view \\huba |
home.cmd home.hta indul.cmd DisablePasswordCaching.vbs |
@echo off net use * /d /y net time \\huba /set /yes |
<html lang = "hu"> <head> <body onload="window.resizeTo(455,330)"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta content="text/html; charset=UTF-8" http-equiv="content-type"> <title>SULI Home könyvtár</title> </head> <script language="VBScript"> <!-- Sub OKButton_OnClick driveletter = "Z:" name = UserNameBox.value name = Trim(name) pswd = PasswordBox.value pswd = Trim(pswd) UserNameBox.value = "" PasswordBox.value = "" Set WshShell = CreateObject("Wscript.Shell") WshShell.Run "net use z: \\huba\homes /PERSISTENT:NO " & pswd & " /user:" & name,,True WshShell.Run "explorer z:" End Sub '--> </script> <body bgcolor="#66FFCC"> <p></p> <p align="center"> <font face="Arial"> <b>HOME könyvtár csatlakoztatása</b></font></p> <p align="left" style="margin-top: 0; margin-bottom: 0"> <font face="Arial" size="2">Home könyvtára <b>Z:</b> meghajtóként megjelenik a Sajátgépben. </font> </p> <p align="left" style="margin-top: 0; margin-bottom: 0"> <font face="Arial" size="2"> A meghajtó alapértelmezett mérete 200 Mb. Mielőtt elhagyja a gépet, mindenképp jelentkezzen ki!</font></p> <p><b>Írja be felhasználói nevét: </b> <input TYPE="text" Name="UserNameBox" size="20"> </p> <p><b>Írja be jelszavát: </b> <input TYPE="password" Name="PasswordBox" size="20"> </p><p> <input NAME="OKButton" TYPE="BUTTON" VALUE="OK"> </p><p></p> </body> </body> </html> |
net use z: /user:%1 \\huba\homes /PERSISTENT:NO explorer z: |
net use t: \\huba\tanari /PERSISTENT:NO explorer t: |
create
mask = 0664 directory mask =0775 |
net use x: \\huba\admhome /PERSISTENT:NO |
[manomatek4] comment = Manomatek 4 path = /megoszt/oktat/manomatek4d guest ok = yes writable = no share modes = no browseable = no |
[root@centos5 ~]# service smb restart |
net use w: /delete /yes net use w: \\huba\manomatek4 w: start.exe |
#!/bin/bash clear TANAR=pf DATE=`date +'%Y_%m_%d-%k_%M'` echo "A tanulók önalló munkainak másolása" echo "Add meg az osztaly csoportazonosítóját" echo read CSOPORT if test -s /etc/squid/csoportok/"$CSOPORT".txt then echo "Ennek az osztalynak tanulói:" for i in `cat /etc/squid/csoportok/"$CSOPORT".txt` do cat /etc/passwd | echo -n " " `grep -w $i | cut -d":" -f5 ` done echo echo '? (y/n)' read B if test $B = "y" then mkdir /home/$TANAR/Dokumentumok/dolgozat_"$DATE"_"$CSOPORT" echo "Add meg a könyvtár nevét amit a tanulók létrehoztak:" read DIR for j in `cat /etc/squid/csoportok/"$CSOPORT".txt` do NEV=`cat /etc/passwd | grep -w $j | cut -d":" -f5 ` mkdir /home/$TANAR/Dokumentumok/dolgozat_"$DATE"_"$CSOPORT"/"$NEV" rsync -agE /home/"$j"/Dokumentumok/"$DIR"/ /home/$TANAR/Dokumentumok/dolgozat_"$DATE"_"$CSOPORT"/"$NEV" done fi exit 0 else echo "nincs ilyen csoport!" fi |
[pf@centos5 ~]# ./dolgozat.scp A tanulók önalló munkainak másolasa Add meg az osztaly csoportazonositóját: g2002a Ennek az osztalynak tanulói: Szabo Hajnalka Szegedi Pal Ligeti Lajos Nagy Piroska ? (y/n) y Add meg a könyvtár nevét amit a tanulók létrehoztak: 0420 [pf@server ~]$ |