Ubuntu File Server

by Nav N in Circuits > Linux

19572 Views, 56 Favorites, 0 Comments

Ubuntu File Server

ubuntuserverfileserver.png

Ubuntu server is a great lightweight OS for servers, and paired with samba you can have the ultimate home file server. Having a file server is a very good idea, because You may want to use it as: a backup, a media streamer and a "shared" folder. But these are just a few reasons you may want to make one, so let's get into it!

Install the Software

temp_725060798.jpg
To start off, you need to make Ubuntu Server capable of file hosting. So to do this we will need to install samba. So type in the command: sudo apt-get install samba. Now wasn't that easy, We have installed ALL the software!

Configuring Samba

temp_-1810721262.jpg
temp_-909753796.jpg
To decide what you want samba to do, they have made a config file where it contains hundreds or commented commands. So open /etc/samba/smb.conf with a text editor like nano. First uncomment or add security = user, this can be found under the authentication header in the file. Then add these lines of code:

[Fred]
comment = Fred's Files
path = /path/to/folder
writable = yes
read only = yes
create mask = 0755
available = yes

Now add a password to your user with this command: sudo smbpasswd fred

Then type: sudo service smbd restart

Drive Auto Mount

temp_-1323435208.jpg
temp_-1610764225.jpg
If your computer's hard drive is not large enough you may want to use an external hard drive. But cannot simply just plug it in, you will have to make it auto mount with the correct permissions. So you will need to type the command blkid to the the hard drive's uuid then type this code at the end of /etc/fstab:

UUID=XXXXXXXXX /media/NASdrive user,umask=000,utf8 -->noauto
Then save it and type sudo mkdir /media/NASdrive and then sudo reboot.

View the Server

temp_-1006312360.jpg
temp_-1485082359.jpg
Well done! You have finished setting up your server! But how do you access you're files? Well, on Android you can use File Manager by Asus ZenUI and on desktop computers you can simple open your file manager and browse your network.