This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
virtualisation:file-server [2018/02/26 13:11] – buettner | virtualisation:file-server [2018/03/15 15:27] – buettner | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== NB2800 File Server ====== | + | ====== |
This Article describes how to install a file server on the NB2800 router. | This Article describes how to install a file server on the NB2800 router. | ||
Line 5: | Line 5: | ||
If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: [[http:// | If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: [[http:// | ||
- | In this setup, | + | This setup contains the installation and configuration of the vsftpd FTP server, the Net2FTP web frontend for vsftpd, and Samba shares. In addition, a way is shown to transfer files from an USB stick to your container: |
==== 1) Preparations ==== | ==== 1) Preparations ==== | ||
- | The first step you should take is to give your router a static IP adress. For this, use | ||
- | < | ||
- | nano / | ||
- | </ | ||
- | and set up a static IP configuration for your primary interface. In this example, the configuration for the eth0 interface looks like this: | ||
- | < | ||
- | auto eth0 | ||
- | iface eth0 inet static | ||
- | address 192.168.1.50 | ||
- | netmask 255.255.255.0 | ||
- | network 192.168.1.0 | ||
- | broadcast 192.168.1.255 | ||
- | gateway 192.168.1.105 | ||
- | dns-nameservers 192.168.1.105 | ||
- | </ | ||
- | After that, use | + | The first step you should take is to use |
< | < | ||
apt-get update | apt-get update | ||
Line 88: | Line 73: | ||
</ | </ | ||
to create a pair of keys. In this configuration, | to create a pair of keys. In this configuration, | ||
+ | |||
+ | < | ||
+ | root@LXC_MEDIA: | ||
+ | Generating a 2048 bit RSA private key | ||
+ | ...........................................................................+++ | ||
+ | ............................................+++ | ||
+ | writing new private key to '/ | ||
+ | ----- | ||
+ | You are about to be asked to enter information that will be incorporated | ||
+ | into your certificate request. | ||
+ | What you are about to enter is what is called a Distinguished Name or a DN. | ||
+ | There are quite a few fields but you can leave some blank | ||
+ | For some fields there will be a default value, | ||
+ | If you enter ' | ||
+ | ----- | ||
+ | Country Name (2 letter code) [AU]:DE | ||
+ | State or Province Name (full name) [Some-State]: | ||
+ | Locality Name (eg, city) []:Eschborn | ||
+ | Organization Name (eg, company) [Internet Widgits Pty Ltd]: | ||
+ | Organizational Unit Name (eg, section) []:Test | ||
+ | Common Name (e.g. server FQDN or YOUR name) []: | ||
+ | Email Address []: | ||
+ | root@LXC_MEDIA: | ||
+ | </ | ||
+ | |||
+ | While the certificates are created, you can answer every question as you wish, but be aware that at " | ||
+ | |||
The main configuration of vsftpd is made in the / | The main configuration of vsftpd is made in the / | ||
Line 124: | Line 136: | ||
==== 3) Net2FTP ==== | ==== 3) Net2FTP ==== | ||
- | ([[https:// | + | [[https:// |
First, you have to download the Software from this [[https:// | First, you have to download the Software from this [[https:// | ||
Line 212: | Line 224: | ||
</ | </ | ||
to check if your samba configuration contains any errors. | to check if your samba configuration contains any errors. | ||
+ | |||
+ | < | ||
+ | root@LXC_MEDIA:/# | ||
+ | Load smb config files from / | ||
+ | rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) | ||
+ | WARNING: The " | ||
+ | Processing section " | ||
+ | Processing section " | ||
+ | Processing section " | ||
+ | Processing section " | ||
+ | Processing section " | ||
+ | Processing section " | ||
+ | Loaded services file OK. | ||
+ | Server role: ROLE_STANDALONE | ||
+ | |||
+ | Press enter to see a dump of your service definitions | ||
+ | |||
+ | # Global parameters | ||
+ | [global] | ||
+ | log file = / | ||
+ | max log size = 1000 | ||
+ | syslog = 0 | ||
+ | panic action = / | ||
+ | usershare allow guests = Yes | ||
+ | map to guest = Bad User | ||
+ | obey pam restrictions = Yes | ||
+ | pam password change = Yes | ||
+ | passwd chat = *Enter\snew\s*\spassword: | ||
+ | passwd program = / | ||
+ | server role = standalone server | ||
+ | unix password sync = Yes | ||
+ | dns proxy = No | ||
+ | idmap config * : backend = tdb | ||
+ | |||
+ | |||
+ | [homes] | ||
+ | comment = Home Directories | ||
+ | browseable = No | ||
+ | create mask = 0700 | ||
+ | directory mask = 0700 | ||
+ | valid users = %S | ||
+ | |||
+ | |||
+ | [printers] | ||
+ | comment = All Printers | ||
+ | path = / | ||
+ | browseable = No | ||
+ | printable = Yes | ||
+ | create mask = 0700 | ||
+ | |||
+ | |||
+ | [print$] | ||
+ | comment = Printer Drivers | ||
+ | path = / | ||
+ | |||
+ | |||
+ | [Fotos] | ||
+ | path = / | ||
+ | read only = No | ||
+ | |||
+ | |||
+ | [Videos] | ||
+ | path = / | ||
+ | read only = No | ||
+ | |||
+ | |||
+ | [Musik] | ||
+ | path = / | ||
+ | read only = No | ||
+ | </ | ||
In the last step, type | In the last step, type | ||
Line 219: | Line 301: | ||
to restart the samba server. | to restart the samba server. | ||
+ | To add the shared folders to your Windows machine, go to "This PC (Arbeitsplatz)" | ||
+ | {{ : | ||
+ | |||
+ | In the next window, click on " | ||
+ | {{ : | ||
+ | |||
+ | Now enter the address of your shared folder in the form " | ||
+ | {{ : | ||
+ | |||
+ | In the next window, enter a name for your shared folder. | ||
+ | {{ : | ||
+ | |||
+ | Now click on " | ||
+ | {{ : | ||
+ | |||
+ | {{ : | ||
==== 5) transfer files with an USB Stick ==== | ==== 5) transfer files with an USB Stick ==== | ||
- | :!: In der NB2800-UI zunächst die USB-Funktion aktivieren: | ||
- | Interfaces - USB - Administration - enabled | ||
- | -" | ||
- | -hier sollte man sich die autorun.key-Datei herunterladen. Diese enthält den Hash-Wert des Passworts, mit dem man sich auf dem Router angemeldet hat; sie ist also notwendig, um den Besitzer des USB-Sticks als zum Ausführen von Aktionen berechtigt zu identifizieren. | ||
- | :!: Diese autorun.key-Datei muss zusammen mit einer autorun.sh-Datei auf dem USB-Stick gespeichert werden. | + | The next possibelity to copy files to your router is by using an USB Stick. |
+ | For this, go to Interfaces | ||
+ | {{ : | ||
- | :!: FAT16 oder FAT32 | + | Next, go to " |
+ | {{ :virtualisation:usb_2.png? | ||
+ | This file contains the hash values of the password the user uses to login to the router. So this file is necessary automatically run actions with root level access. | ||
+ | |||
+ | In the next step you have to create the " | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | In this example, files located in folders on the stick (Video-trans, | ||
- | -Dateien auf dem Stick werden auf den Router kopiert wobei existente Dateien ignoriert werden. | ||
< | < | ||
rsync -arv --ignore-existing / | rsync -arv --ignore-existing / | ||
rsync -arv --ignore-existing / | rsync -arv --ignore-existing / | ||
rsync -arv --ignore-existing / | rsync -arv --ignore-existing / | ||
- | |||
</ | </ | ||
- | -Die Ordnerinhalte auf dem Router werden 1:1 mit den Ordnern auf dem Stick synchronisiert. D.h. wenn eine Datei auf dem Stick gelöscht wird wird sie auch auf dem Router glöscht usw. | + | In the second example, all files in the container will be replaced by the files stored on the USB stick. You will get an one-to-one copy of your USB stick: |
< | < | ||
rsync -arv --delete / | rsync -arv --delete / | ||
Line 245: | Line 347: | ||
rsync -arv --delete / | rsync -arv --delete / | ||
</ | </ | ||
+ | |||
+ | Now format an USB stick to the FAT16 oder FAT32 file format. Copy to it the " | ||
+ | < | ||
+ | / | ||
+ | drw-r--r-- | ||
+ | drw-r--r-- | ||
+ | drw-r--r-- | ||
+ | drw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | -rw-r--r-- | ||
+ | |||
+ | </ | ||
+ | |||
+ | If you now plug in the stick into the router, the stick is mounted to the file system and all tasks from the " | ||
+ | |||
+ |