summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/smb_nfs/howtos/si
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/smb_nfs/howtos/si')
-rw-r--r--kpov_judge/tasks/smb_nfs/howtos/si/index.html408
1 files changed, 69 insertions, 339 deletions
diff --git a/kpov_judge/tasks/smb_nfs/howtos/si/index.html b/kpov_judge/tasks/smb_nfs/howtos/si/index.html
index 03ef0cb..1c77ca6 100644
--- a/kpov_judge/tasks/smb_nfs/howtos/si/index.html
+++ b/kpov_judge/tasks/smb_nfs/howtos/si/index.html
@@ -1,339 +1,69 @@
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html" charset="utf-8">
-<title>smb_nfs</title>
-<style type="text/css">
- #code {
- font-family: Courier New;
- font-size: 12;
- }
-</style>
-</head>
-<body>
- <h1>
- smb_nfs
- </h1>
- <p>
- <a href="#vb">VirtualBox</a> | <a href="#server">Strežnik</a> | <a href="#client">Odjemalec</a> | <a href="#nfs">NFS</a> | <a href="#smb">Samba</a> | <a href="#dhcp">DHCP</a>
- </p>
- <h2>
- Hitra navodila
- </h2>
- <p>
- Postavi dva navidezna računalnika - simpleArbiterDhcp in FileServer.
- </p>
- <p>
- 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.
- </p>
- <p>
- SimpleArbiterDhcp naj ima prek NFS pravico pisati po imeniku.
- </p>
- <h2>
- Navodila
- </h2>
- <ul style="list-style: none;">
- <li>
- <h3>
- Prenesi sledeče slike virtualk:
- </h3>
- <ul type="disc">
- <li>
- student-fileserver.vdi
- </li>
- <li>
- simpleArbiterDhcpGW.vdi
- </li>
- <br>
- </ul>
- </li>
- <a name="vb"></a>
- <li>
- <h3>
- Nastavitve v VirtualBox:
- </h3>
- <ul type="disc">
- <li>
- Za obe napravi je potrebno omogočiti PAE/NX: Settings&rArr;System&rArr;Processor
- </li>
- <li>
- Za FileServer
- <ul>
- <li>
- vmesnik 1 - NAT
- </li>
- <li>
- vmesnik 2 - Internal Network
- </li>
- </ul>
- </li>
- <li>
- Za SimpleArbiterDhcp
- <ul>
- <li>
- vmesnik 1 - Internal network
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <br>
- <a name="server"></a>
- <li>
- <h3>
- Strežnik FileServer
- </h3>
- <ol>
- <a name="dhcp"></a>
- <li>
- Postavi DHCP strežnik
- <ol>
- <li>
- <span id="code">
- apt-get update
- </span>
- </li>
- <li>
- <span id="code">
- apt-get install isc-dhcp-server</span>
- </li>
- <li>
- Strežnik se ne bo zagnal (javi <span id="code">Starting ISC DHCP server: dhcpdcheck syslog for diagnostics. ... failed!</span>), potrebno je popraviti 3 datoteke:
- <ul>
- <li>
- V /etc/network/interfaces določi statičen IP vmesnika eth1, na njem bo tekel DHCP strežnik,
- npr.:
- <p id="code">
- auto eth1<br>
- iface eth1 inet static<br>
- address 192.168.1.10<br>
- netmask 255.255.255.0<br>
- network 192.168.1.0<br>
- broadcast 192.168.1.255<br>
- </p>
- </li>
- <li>
- V /etc/default/isc-dhcp-server:
- <p id="code">
- INTERFACES="eth1"
- </p>
- </li>
-
- <li>
- V /etc/dhcp/dhcpd.conf določi lastnosti podomrežja,
- npr.:
- <p id="code">
- authoritative;<br>
- default-lease-time 600;<br>
- max-lease-time 7200;<br>
- <br>
- subnet 192.168.1.0 netmask 255.255.255.0 {<br>
- range 192.168.1.100 192.168.1.200;<br>
- option routers 192.168.1.10;<br>
- option domain-name-servers 193.2.1.66, 8.8.4.4;<br>
- <br>
- host SimpleArbiter {<br>
- hardware ethernet 08:00:27:A2:FB:B4;<br>
- fixed-address 192.168.1.180;<br>
- }<br>
- }<br>
- </p>
- </li>
- </ul>
- </li>
- </ol>
- </li>
- <a name="nfs"></a>
- <li>
- Postavi NFS strežnik
- <ol>
- <li>
- <span id="code">
- apt-get install nfs-kernel-server
- </span></li>
- <li>
- Določi pravila v /etc/exports, npr.:
- <p id="code">
- #pravice za SimpleArbiterDhcp<br>
- /srv/nfs/ERLbbBrT 192.168.1.180(rw,sync,insecure)<br>
- /srv/nfs/ERLbbBrT 192.168.1.0/24(ro,sync,insecure)<br>
- </p>
- </li>
- <li>Spremeni lastnika mape in datotek v njej:
- <span id="code">
- chown student /srv/nfs/ERLbbBrT
- </span>
- ter podobno za datoteke v deljeni mapi. Lastnik naj ne bo root.
- </li>
- <li>
- Poženi ukaz
- <span id="code">exportfs -rv</span>"
- za izvoz datotečnih sistemov
- <p>In nato še
- <span id="code">
- service nfs-kernel-server restart
- </span>
- </p>
- </li>
- <br>
- </ol>
- </li>
- <a name="smb"></a>
- <li>
- Postavi SMB strežnik
- <ol>
- <li>
- <span id="code">
- apt-get install samba
- </span></li>
- <li>
- Ustvari mapo urania-03 ter določi lastnika in pravice:
- <p id="code">
- mkdir /home/urania-03<br>
- chown -R root:users /home/urania-03/<br>
- chmod -R ug+rwx,o+rx+w /home/urania-03<br>
- </p>
- </li>
- <li>
- <p>Uredi nastavitve v /etc/samba/smb.conf:</p>
- <p id="code">
- [global]<br>
- workgroup = users<br>
- server string = zarptica-32<br>
- dns proxy = no<br>
- log file = /var/log/samba/log.%m<br>
- max log size = 1000<br>
- syslog = 0<br>
- panic action = /usr/share/samba/panic-action %d <br>
- security = user<br>
- encrypt passwords = yes<br>
- passdb backend = tdbsam<br>
- obey pam restrictions = yes<br>
- unix password sync = yes<br>
- passwd program = /usr/bin/passwd %u<br>
- passwd chat = *Enter\snew\s*\spassword:* %n\n <br>*Retype\snew\s*\spassword:* %n\n <br>*password\supdated\ssuccessfully* .<br>
- pam password change = yes<br>
- map to guest = bad user<br>
- usershare allow guests = yes<br>
- <br>
- [homes]<br>
- comment = Home Directories<br>
- browseable = no<br>
- read only = yes<br>
- create mask = 0700<br>
- directory mask = 0700<br>
- valid users = %S<br>
- <br>
- [printers]<br>
- comment = ALl Printers<br>
- browseable = no<br>
- path = /var/spool/samba<br>
- printable = yes<br>
- guest ok = no<br>
- read only = yes<br>
- create mask = 0700<br>
- <br>
- [print$]<br>
- comment = Printer Drivers<br>
- path = /var/lib/samba/printers<br>
- browseable = yes<br>
- read only = yes<br>
- guest ok = no<br>
- <br>
- [urania-03]<br>
- comment = All Users<br>
- path = /home/urania-03<br>
- users = @users<br>
- force group = users
- create mask = 0660<br>
- directory mask = 0771<br>
- writable = yes<br>
- </p>
- </li>
- <li>
- Ponovno zaženi Sambo:
- <span id="code">
- service samba restart
- </span>
- </li>
- <li style="list-style-type:none;">
- <p>
- Preveri sintakso smb.conf datoteke z ukazom
- <span id="code">
- testparam
- </span>
- </p>
- </li>
- <li>
- Dodaj uporabnike
- <p>
- Potrebno je določiti gesla Samba uporabnikom. Uporabnik mora obstajati tudi kot lokalni uporabnik.
- </p>
- <p>
- Z ukazom
- <span id="code">
- useradd USERNAME --shell /bin/false
- </span>
- ustvariš uporabnika z onemogočenim računom in brez domačega direktorija, npr.:
- <p id="code">
- useradd tester --shell /bin/false
- </p>
- </p>
- <p>
- Za uporabnika določi Samba geslo:
- <p id="code">
- smbpasswd -a tester
- </p>
- </p>
- <p>
- Dodaj uporabnika v skupino.
- <p>
- Odpri /etc/group
- ter na konec dokumenta dodaj:
- <span id="code">
- users:x:1002:tester
- </span>
- </p>
- </p>
- </li>
- <li> Ponovno zaženi Sambo.
- </li>
- </ol>
- </li>
- </ol>
- </li>
- <br>
- <a name="client"></a>
- <li>
- <h3>
- Odjemalec SimpleArbiterDhcp
- </h3>
- <ul type="disc">
- <li>Ustvari mapi za deljene datoteke, npr.:
- <p id="code">
- mkdir mnt<br>
- mkdir mnt/smb<br>
- mkdir mnt/nfs<br>
- </p>
- </li>
- <li>
- NFS: Poženi ukaz
- <p id="code">
- sudo mount 192.168.1.10:/srv/nfs/ERLbbBrT /mnt/nfs
- </p>
- </li>
- <li>
- SMB: Poženi ukaz
- <p id="code">
- sudo mount -t cifs //192.168.1.10/urania-03 /mnt/smb -o username=tester,password=test,workgroup=users<br>
- </p>
- </li>
- <p>
- Sedaj bi moral imeti dostop do deljenih map.
- </p>
- </ul>
- </li>
- </ul>
-</body>
-</html> \ No newline at end of file
+<DOCTYPE html>
+ <html lang="sl">
+
+ <head>
+ <title>SMB NFS How To</title>
+ <meta charset="utf-8" />
+ <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
+ </head>
+
+ <body class="container">
+ <h1 id="kpov-judge-7-smb-nfs">KPOV Judge 7 (SMB NFS)</h1>
+ <p>V tej vaji postavimo na linux-u strežnik za nudenje datotek prek mreže in strežnik za SMB, s katerim lahko na Windows sistemih postavimo datoteko v skupno rabo. Pazi da bo simpleArbiterDhcpGW imel NFS pravico pisanja po imeniku!</p>
+ <h2 id="virtualni-računalniki">Virtualni računalniki</h2>
+ <ul>
+ <li>simpleArbiterDhcpGW</li>
+ <li>student-fileserver</li>
+ </ul>
+ <h3 id="simplearbiterdhcpgw">simpleArbiterDhcpGW</h3>
+ <p>Naj ima 2 omrežna vmesnika, prvi naj bo preko NAT povezan na svetovni splet, drugi vmesnik pa naj vsebuje interno povezavo znotraj virtualnih sistemov na tvojem računalniku “<i>intnet</i>”.</p>
+ <h3 id="student-fileserver">student-fileserver</h3>
+ <p>Naj ima 1 omrežni vmesnik, povezan na interno omrežje “<i>intnet</i>”.</p>
+ <h2 id="parametri">Parametri</h2>
+ <div class="figure">
+ <img src="../images/parameters.png" alt="Parametri" />
+ <p class="caption">Parametri za reševanje naloge</p>
+ </div>
+ <p>Tokrat imamo tri parametre. “Imenovani” <strong>dir</strong>, <strong>smb-share</strong>, <strong>smb-server</strong>.</p>
+ <p>Oziroma iz slike so to: </p>
+ <ul>
+ <li><strong>dir</strong> = TeNVU84X</li>
+ <li><strong>smb-share</strong> = aurora-85</li>
+ <li><strong>smb-server</strong> = melete-04</li>
+ </ul>
+ <h2 id="postopek">Postopek</h2>
+ <p>Ko zaženemo simpleArbiterDhcpGW in student-fileserver se najprej prijavimo v oba sistema. Nato pa na student-fileserver poženemo</p>
+ <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">apt-get</span> update <span class="kw">&amp;&amp;</span> <span class="ex">apt-get</span> install nfs-kernel-server samba</code></pre></div>
+ <h3 id="nastavitve-nfs">Nastavitve NFS</h3>
+ <p>V datoteki <code>/etc/exports</code> dodamo sledečo vrtstico: <br /><code>/srv/nfs/[dir] [IP simpleArbiterDhcpGW](rw)</code>. <br /><br /> Datoteko shranimo in znova poženemo NFS strežnik.</p>
+ <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">service</span> nfs-kernel-server restart</code></pre></div>
+ <p>Ustvarimo imenik, ki smo ga malce prej navedli v nastavitvah NFS. In nato omogočimo vsem pisanje po tem imeniku.</p>
+ <div class="sourceCode">
+ <pre class="sourceCode bash"><code class="sourceCode bash"><span class="fu">mkdir</span> /srv/nfs/[dir]</code></pre>
+ <pre class="sourceCode bash"><code class="sourceCode bash"><span class="fu">chmod</span> oug+w /srv/nfs/[dir]</code></pre>
+ </div>
+ <h3 id="nastavitve-smb">Nastavitve SMB</h3>
+ <p>Vse nastavitvene datoteke SMB se nahajajo v imeniku: <code>/etc/samba</code>. Zanima pa nas datoteka <code>smb.conf</code>.</p>
+ <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="co"># Datoteka smb.conf</span>
+ [<span class="ex">global</span>]
+
+ <span class="ex">workgroup</span> = WORKGROUP
+ <span class="ex">netbios</span> name = [smb-server] <span class="co"># Nadomestek DNS, ki si ga je izmislil Microsoft</span>
+
+ <span class="co"># Malce nižje pod vrstico =========== Share Definitions =========== dodamo svoje nastavitve</span>
+
+ [[<span class="ex">smb-share</span>]] <span class="co"># Primer iz slike: [aurora-85]</span>
+ <span class="ex">path</span> = /srv/nfs/[dir]
+ <span class="bu">read</span> <span class="va">only</span> <span class="va">=</span> <span class="va">no</span>
+ <span class="ex">guest</span> ok = yes
+ <span class="ex">browseable</span> = yes</code></pre></div>
+ <p>Ko popravimo to datoteko restartamo SMB in NetBios s spodnjima ukazoma.</p>
+ <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">service</span> smbd restart</code></pre>
+ <pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">service</span> nmbd restart</code></pre></div>
+ <h2 id="testiranje">Testiranje</h2>
+ <p>Sedaj samo še testiranje :) Za to pa na <strong>simpleArbiterDhcpGW</strong> poženi testno skripto.</p>
+ <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="ex">./test_task.py</span></code></pre></div>
+
+ </body>
+
+ </html>