HOWTO: Easy, simple GUI setup of smb file server
You want to share files between computers on your LAN?
This is the easiest setup of a file server in ubuntu 10.10 that you will find (smb for windows compatibility).
There are tons of other posts and web pages on this, but IMHO most newbies will hate them: they're long, complex, and full of terminal commands and file edits.
This guide has NO editing of files, and only 1 (one) single OPTIONAL line to type into a terminal. Every single step is spelt out, for the sake of absolute newcomers. Other users may want to read only the sub-headings.
Step 1: the core HOWTO - setting up the file server
Step 2: giving your server a static IP address
Step 3: connecting an Ubuntu client
Step 4: connecting a Windows client
Step 1. Creating an Ubuntu File Server
1.1: Make a shared folder on the server
- locate or create the folder you will be placing your shared files in
- right-click it, select ''Sharing Options''
- tick ''Share this folder''
- I suggest you make the ''Share name'' the same as the folder name
- tick ''Allow others to create...'' if you want clients to be able to put files onto the server
- tick ''Guest Access'' to create an insecure server that doesn't need a password (not recommended)
- ''Create Share''
Note during step 1.1 you may be asked to allow Samba to be installed, and to allow Nautilus to ''Add the permissions automatically''. You should allow these if asked.
1.2: Create a share user account on server (optional)
This step is to create a user account on the server. Clients will use this account when they access the file server.
Note this step can be skipped if you ticked ''Guest Access'' in step 1.1, or if you want to let clients use an already existing user account.
- go to System > Administration > Users and Groups, click Add
- give the user account a name (I will use ''sharer'' in this guide), click ok
- give the user a password, click ok
1.3: Create a samba password
Skip this step if you ticked ''Guest Access'' in step 1.1
- type this into a terminal: sudo smbpasswd -a sharer (note ''sharer'' can be any existing Ubuntu user on the server)
- you will be prompted for YOUR password (because of sudo) then twice for a new samba password for sharer.
Note this password does not have any relationship with the Ubuntu password for the ''sharer'' user! You can use the same password if you want, although it would be more secure to use a different one
That's it. The server is finished.
Step 2. Giving the Server a Static IP Address (optional but recommended)
The server will work fine as is, but if it disconnects and reconnects to your router it may end up with a new IP address, which could be annoying...
Follow the steps below to give your server a static IP address that won't ever change.
- to get your gateway's IP address rightclick the network/connection icon in your Notification Area (i.e. ''Task Bar'' for Windows users) and select ''Connection Information''
You now know your gateway address, which is probably 192.168.1.1
You will also need to choose a new permanent IP address for your server.
It will look like 192.168.1.X, where the first three numbers separated by dots are the same as the first 3 of your gateway and the X is a number between 2 and 254.
Your LAN is probably only using a handful of the smaller numbers, so just choose a large number up to 254 that's easy to remember, to insert where the X is.
I'm going to use 192.168.1.222 in this example - you can use this too if you like.
- go to System > Preferences > Network Connections
- find the server's active connection to the router, in the appropriate tab, select it and click ''Edit''
- go to the IPV4 tab
- change the Method to ''manual''
- click ''Add'' next to the ''Addresses'' box
- type your chosen server IP address (''192.168.1.222'') in the Address column
- type ''24'' (no speech marks) in the Netmask column
- type the gateway address from above in the Gateway column, and again in the ''DNS Servers'' text box
- Apply the changes
Your server now has a static IP address.
Step 3. Connecting an Ubuntu Client
- go to Places > Network
- you should see the server here and, if you double-click it, the share folder inside it
- to open the folder you must enter the username of a user account on the server that has had a samba password created for it (sharer, in this example) and the *samba* password for sharer (NOT sharer's Ubuntu password)
- to add the server's share folder to your Places menu for easier access next time, click Bookmarks > Add Bookmark at the top of the window when you are inside the share folder
If you could not see the server in the Network window, do the following:
- Places > Connect to Server
- set Service Type to ''Windows share''
- in the Server field type the server IP address (if you don't know it, then on the *server* rightclick the network/connection icon in your Notification Area and select Connection Information)
- click Connect
- a window with all the share folders on the server will open; doubleclick the one you want, then bookmark it as above
You now have working file sharing between your server and an Ubuntu client on your LAN.
Step 4. Connecting a Windows Client
XP: Start > MyComputer > MyNetworkPlaces > the shared folder
Win7: Start > Computer > rightclick > Add Network Location > follow the wizard prompts
Last edited by Cracklepop; February 16th, 2011 at 03:22 AM.
Tags for this Thread