> Best blogg: linux sever
Showing posts with label linux sever. Show all posts
Showing posts with label linux sever. Show all posts

Wednesday, April 23, 2014

Setting Up A Linux File Server Using Samba

 Setting Up A Linux File Server Using Samba

Setting Up A Linux File Server Using Samba 
Setting Up A Linux File Server Using Samba



Download Ubuntu Server and create the boot CD, then download the corresponding Ubuntu Server Guide from https://help.ubuntu.com/. I  will be referring to this guide a lot so print it off or keep it open on another PC.

** It is important you use the guide written for your version of Ubuntu  Server as some commands change between versions (this was one of the issues I had with other tutorials). This may also cause problems if you upgrade to a new version of Ubuntu so I suggest you use the most recent LTS (long term support) version and stick to it.

Boot off the CD and follow installation instructions. I selected Guided - Use entire Disk. I did not select LVM as I had issues retrieving data from an earlier attempt, where I screwed up the interfaces file and it wouldn't boot (yes I know you can mount LVM from a Live Disk but I can't be bothered with the hassle) this is a simple home server so I like to keep everything as simple as possible.

Give your server a name, create a user and set a sensible password. (this will also be your admin password so it should include capitals and symbols or numbers), I'll explain more about this later.
**** NB When creating the user make it something like serveradmin. Do not make this username the same as your Windows username. If you do it may cause issues later.****

Select Samba and SSH during the installation procedure by moving up and down with the arrow keys and pressing the space bar. Use the Tab key to skip to the next or back buttons. Now continue with the installation and in a few minutes you will be presented with the Ubuntu Server login screen. If at this stage you were expecting a graphical user interface with shiny buttons and a mouse then you will be disappointed. This can be installed if you really wish but that defeats the purpose of using the server edition of Ubuntu. On this version of Ubuntu you will have to get your hands dirty on the keyboard.

Step 2

Login with your user name and password.
Install updates :-
sudo apt-get update
This just ensures everything is up to date.
You should be prompted for a password. Use the one you created earlier.

Step 3

In the Ubuntu Server Guide you downloaded earlier look for the chapter on Windows Networking and follow the instructions for Samba File Server.

NB You shouldn't need to run the install command for Samba as it was installed earlier but if you have run it and are being asked which version of smb.conf you want, I suggest you keep the one already installed. This is especially true if you have already made changes to it.

** Before you start editing the smb.conf file, copy it to something like smb.conf_backup. You will probably cock things up the first time you attempt this so it is nice to be able to get back to square one. :- 
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
I use Nano for editing text files from the CLI (command line interface). I hate Vi with a passion, that may be cause I'm a bit thick, but I find Nano much easier to use. So your command to edit the smb.conf file will be :-
sudo nano /etc/samba/smb.conf
You need to be an admin user to save any changes when you're finished editing, hence the sudo in front of nano.

In Ubuntu any command which may change the server configuration needs to be carried out by the admin user. Since for security reasons you cannot login as root (the admin user) the alternative is to insert sudo before every command then provide the admin password, this keeps things nice and secure. Other Distros allow you to type su (for super user) then the password and this will give admin access until you logout.

Check the workgroup name in your Windows PC by right clicking on My Computer, select properties and Computer name. It will probably be WORKGROUP or MSHOME, depending on your version of XP. Sorry not sure how to find out in Vista or W7 but probably something similar.

Now follow the instructions carefully. Some of the commands are already in the smb.conf file but have a # symbol in front of them, removing the # symbol makes the command active.

To close Nano and save your changes press CTRL and X, type y and press enter. CTRL and O is shown as Write out which just means SAVE, if you want to save it as you go along.

NB. Pretty much everything in Linux is case sensitive, i.e. If you gave your folder names capitals when creating, them then you MUST use capitals when referring to them or moving around the file structure. Linux will see Music and music as two completely different folders.

Step 4

This bit may or may not be necessary, as far as I can see it depends on the version of Ubuntu Server and whether or not you installed Samba as part of the server installation. To connect from either a Linux or Windows PC you need to make one more small change. Look for the area in smb.conf marked Authentication, and just below the bit where you set security to user, change:-

encrypt passwords = false 

encrypt passwords = true
Save it, restart Samba by the method suggested for your version of Ubuntu Server (it seems to change between versions) or just reboot the server and you should done.

Step 5

Now to the bit nobody else mentions in their tutorials and I had to figure out for myself. How do I connect to the bugger?!!! I tried browsing "Network Connections" but that didn't work, possibly because at this point we haven't created Samba users to match our Windows users but anyhow we don't need to. Here is how I did it.

Note you experts out there may criticize my way of doing this but it's simple and it works so don't knock it.

If not sure of your server IP address just type ifconfig at the command prompt. This will give you a full breakdown of your network details.
From a Win XP Pro machine (sorry not sure it this is the same for other versions of Windows but it should be similar).

Open My Computer.
Click on Tools and Map network Drive.

In the window labeled Folder, enter the IP address of your server preceded by \\ and followed by \sharename (where sharename is the name of the share you created earlier).

e.g. :- \\\Music or \\\Photos

Press Finish and if everything has worked you should now see the network folder. You can create a shortcut to it for easy access in the future but Windows should remember the network drive name you just created.
To connect from a Linux PC:- (I am using Ubuntu 10.10, sorry not sure about other Distros but other versions of Ubuntu should be similar)

Click on Places and select Connect to Server.
Select Windows Share and type in the server IP address in the window labeled Server.
Enter the share name you created, put a tick in create bookmark (this just makes Ubuntu remember the path after logout or reboot) and click on connect. Do not enter any username or password, it shouldn't be necessary if you followed the guide earlier.

And that's it. Yippee you now have a working file server.

During installation you installed SSH and having SSH running on your server in default mode can be a security risk, so we want to sort that. We need to change the default port to a random number of your own choosing. To do this follow the instructions in the Ubuntu Server Guide under the chapter Remote Administration. The default port is 22 which many people don't bother changing so this is the one used by hackers and hacking software to try and gain access to your server. There are a few other options there but I haven't bothered with them.

Step 6

Unless you chose to give your server a static IP address during installation it will have a DHCP address assigned to it by your router. This would be fine so long as you never reboot your router or shutdown the server. Sooner or later though it will pick up a different IP address and you will be left disconnected, so we will give it a static one. Check the current IP address by typing

at the command prompt. You only want to change the last part so for example if it is then change it to You can set the last part to be any number between 2 and 254, mine is 101.
In the Ubuntu Server Guide open the chapter Networking – Network Configuration - IP addressing and select Static IP Address Assignment.
sudo nano /etc/network/interfaces
It should look something like

auto eth0
iface eth0 inet static
The gateway is normally the IP address of your router which is usually or but may be something completely different. If you ran
on your Windows PC it should have shown you the gateway address. If in doubt check your manual or Google the model of your router.
You might also want to check the IP address of your Windows PC, it should be similar to the server but it may previously have been set to a static address.

from the Start button (or Start and Run in XP). Then type

at the command prompt. This should show your IP address which will be something like or Whatever it is your PC and server should be in the same range of IP addresses (this just means the first three parts should be the same).

Step 7

Now that you've a working server you'll want to tuck it away somewhere, minus monitor, k/b and mouse of course (if your system board can boot without a k/b that is, it should be an option in the BIOS to ignore errors on boot). During the initial installation of Ubuntu Server you selected to install SSH. This is a protocol (program) which allows you to administer your server remotely from any PC (or even smart phone). If you didn't don't worry, just type:-

sudo apt-get install openssh-server
The easiest way to connect from another PC is to install Putty. A quick Google of Putty will have you up and running in a few seconds. When you launch Putty you will see it asking for a Host Name (or IP address). Just type in your server IP address and new port number, ensure SSH is selected, type a name into Saved sessions and click save, then click open. Say Yes to the security question and your connected. Now you can administer the server from your PC/laptop or even smart phone, how cool is that!

So there you have it. You've installed Ubuntu Server and configured it to let your Windows or Linux box connect to it. There are many more things your server can do for you, it can act as a Proxy server screening your network from the Internet and caching frequently used web sites, or as an email server, or a print server etc.

I'm no expert on Linux and I am sure there are other ways to achieve all this. Some of them may even be better but This method is tried and tested several times and if you follow the steps as shown it should work. If you have any suggestions for improving this tutorial then please let us all know .

Tags: Setting Up A Linux File Server Using Samba, Linux File Server, linux, server, linux samba, Linux File Server

Thursday, January 2, 2014

The Best Linux Server Backup

The Best Linux Server Backup
You should look into Linux Server Backup to protect yourself from unforeseen data loss. Your data is the most important thing that you have in today's competitive world. Losing it would be disastrous for your business, as it would alienate your customers. Although data reliability has gone up in the last few years, natural disasters such as hurricanes and earthquakes can threaten your information at any time during the year.

There are also risk factors which are not physical in nature. Your data can be affected by rogue software such as virus, worms and Trojans. It is also susceptible to hacking and other attempts at data manipulation by hackers. A good firewall definitely helps, but having backup solution will make sure that you have the latest records for security.

Linux offers a number of features that makes it the best solution for Linux server backup. The operating system has been built to be very stable and robust, allowing hosted websites to have very high up times. This flexibility allows advanced features to be available at free of cost. Major operating systems like Ubuntu, Red Hat and CentOS have web-based backup options available that let you carry out remote backups whenever you please.

The best thing about Linux is that it offers network encryption. As a matter of fact, this makes it very hard for hackers to break into your data. Most Linux distributions offer 256-bit network encryption and 256-bit AES storage encryption, along with unique security certificates, making your data secure from interception and attacks. These features also stop your data from leaking, ensuring peace of mind for you and your customers.

Another great thing about this backup solution is that it is highly scalable. It can adapt to any environment - from small-scale data to large-scale environments with petabytes of information. Your Linux server backup will be able to meet anything you can throw at it; it will process all data without a hitch.
These are some of the features that you should really look for in Linux backup solution. The operating system's kernel has been built from the ground up to be highly robust and scalable, handling anything you can give it. It is used actively around the world in a number of small and large-scale environments without any problems. It is also highly secure and will protect your Linux server backup from hackers and remote attacks, among other things.

Discover which Linux Server Backup has the "Must Have" features. Visit http://www.druva.com and find out what features are needed before you purchase any backup program. Try our Windows Server Backup Program "Absolutely Free" for 30 Days.
Article Source: http://EzineArticles.com/?expert=John_Z_Perry

Popular Posts


Copyright @ 2013 Best blogg.

Designed by Templateify & Sponsored By Twigplay