Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
virtualisation:file-server-setup-guide [2018/03/16 08:12]
buettner
virtualisation:file-server-setup-guide [2018/09/04 07:11] (current)
juraschek [How to set up a NB2800 File Server]
Line 3: Line 3:
 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. ​
  
-If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: [[http://​wiki.netmodule.com/​app-notes/​virtualisation]].+If you need instructions on how to set up a LXC Container on NB2800 Routers, you can refer to this page: [[virtualisation:start|LXC Virtualization]].
  
 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: 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:
Line 10: Line 10:
 ==== 1) Preparations ==== ==== 1) Preparations ====
  
-The first step you should take is to use  +In the first step, download the [LXC container image LINK] which provides all needed programs ​and a default configuration.
-<​code>​ +
-apt-get update +
-</​code>​ +
-and  +
-<​code>​ +
-apt-get upgrade +
-</​code>​ +
-to bring your system up to date.+
  
 If your network setup doesn'​t include a domain you could use on your router, you can easily create one you can use to access your file server. If your network setup doesn'​t include a domain you could use on your router, you can easily create one you can use to access your file server.
Line 32: Line 24:
 {{ :​virtualisation:​local_domain_lxc.png?​nolink&​600 |}} {{ :​virtualisation:​local_domain_lxc.png?​nolink&​600 |}}
  
-Now you can access the file server with both its IP address ​its local domain name.+Now you can access the file server with both its IP address ​and its local domain name
 + 
 +For logging in to vsftpd/​Net2FTP and Samba, a default user with password was created to easily give access to the programs. The user name used here is "​ftpuser"​ and the password is "​mediac0ntr0l"​ (both without the quotes; be aware that the "​0"​ used in the password are zeros). This configuration is used because this user is setup without any access to any other part of the system; so he has neither a shell access nor any login abilities.  
 +You can change the given password by using 
 +<​code>​ 
 +sudo passwd USERNAME 
 +</​code>​. 
 +On default, all transfered files are saved in the "/​home/​Media/​Bilder Videos Musik" folders.
  
 ==== 2) Net2FTP ==== ==== 2) Net2FTP ====
Line 38: Line 37:
 [[https://​www.net2ftp.com/​|Net2FTP]] is a web interface for FTP servers. With this, you can up-and download files to your server just with your web browser and without the need of additional tools like FileZilla. [[https://​www.net2ftp.com/​|Net2FTP]] is a web interface for FTP servers. With this, you can up-and download files to your server just with your web browser and without the need of additional tools like FileZilla.
  
-You can access the FTP server over the domain name of your router and the addon /ftpserver (For example, if your local domain name is mediacontainer.local you can access it via http://​mediacontainer.local/​ftpserver).+You can access the FTP server over the IP address or domain name of your router and the addon /ftpserver (For example, if your local domain name is mediacontainer.local you can access it via http://​mediacontainer.local/​ftpserver).
  
-==== 4) The samba file server ====+ 
 +==== 3) The VSFTPD FTP Server==== 
 + 
 +Vsftpd is a very smooth working FTP server. You can access it by using a FTP client program like FileZilla, or you can access it via your web browser using Net2FTP as described above. 
 + 
 +If you have changed the user for vsftpd, you have to tell the program about the new user. To do this open the /​etc/​vsftpd.user_list file with an editor (nano, vi,...). In this file, add your preferred user in a new line: 
 +<​konsole>​ 
 +ftpuser 
 +NEW USER 
 +</​konsole>​. 
 +Of course, you can delete the ftpuser entry in this file if only your new user may have access to the server. 
 + 
 + 
 +==== 4) The Samba file server ====
  
 With samba, you can easily share your folders and files from other computers with Windows, Linux or macOS installed. With samba, you can easily share your folders and files from other computers with Windows, Linux or macOS installed.
 +
 +In Samba, the login credentials described in the vsftpd chapter are used again to get access to Samba. If you want to add a new user to Samba, enter
 +<​code>​
 +smbpasswd -a <​username>​
 +</​code>​
 +After this, you are asked to give a new password to this new user. Be aware that while entering this new password, no placeholder like * are shown.
  
 To add the shared folders to your Windows machine, go to "This PC (Arbeitsplatz)"​ and click on "Add a network location (Netzwerkadresse hinzufügen)"​. To add the shared folders to your Windows machine, go to "This PC (Arbeitsplatz)"​ and click on "Add a network location (Netzwerkadresse hinzufügen)"​.
Line 69: Line 87:
  
 Next, go to "​Autorun"​ and again set the Administrative status on "​enabled"​. Also, download the "​autorun.key"​ file from this site. Next, go to "​Autorun"​ and again set the Administrative status on "​enabled"​. Also, download the "​autorun.key"​ file from this site.
 +
 {{ :​virtualisation:​usb_2.png?​nolink&​600 |}} {{ :​virtualisation:​usb_2.png?​nolink&​600 |}}
 +
 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. 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 this example, files located in folders on the stick (Video-trans,​ Audio-trans,​ Bilder-trans) are copied to folders inside of the LXC Container (/​home/​Media/​Videos Bilder Musik). Existing files are being ignored. The /​mnt/​media/​autorun path is the path where the USB stick is mounted to; be aware that this path is not changeable.+In this example ​[LINK], files located in folders on the stick (Video-trans,​ Audio-trans,​ Bilder-trans) are copied to folders inside of the LXC Container (/​home/​Media/​Videos Bilder Musik). Existing files are being ignored. The /​mnt/​media/​autorun path is the path where the USB stick is mounted to; be aware that this path is not changeable.
  
 +In the second example [LINK], 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.
  
-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:+The last example ​[LINK] provides ​the possibility to use an external USB drive as a storage solution for your media players provided in a LXC container. This external drive will be mounted to the /​home/​Media/​USB folder. You can add this folder ​to the media player ​of your choice to let it get access to the media files stored in it. Be aware that the used LXC container will be restarted afterwards.
  
 +Now format an USB stick to the FAT16 oder FAT32 file format. Copy to it the "​autorun.key"​ file together with the "​autorun.sh"​ file and the files and folders (Video-trans,​ Audio-trans,​ Bilder-trans) you want to transfer.
  
-Now format an USB stick to the FAT16 oder FAT32 file format. Copy to it the "​autorun.key"​ file together with the "​autorun.sh"​ file and the files/​folders you want to transfer. 
 <​konsole>​ <​konsole>​
 /​mnt/​media/​autorun $ ls -lh /​mnt/​media/​autorun $ ls -lh