Basic Samba Setup on Ubuntu 8.04 Hardy Heron

The recent post about Ubuntu 8.04 hosing a Samba install has gotten quite a few hits, so it seems that I’m not the only one who’s having this problem. For those having Samba problems with Ubuntu 8.04 (after an upgrade from a previous version), I suspect the best approach would be to uninstall Samba entirely, reinstall it, and redo the settings from scratch. Along those lines, here are instructions on how to install Samba on a Ubuntu 8.04 machine, and how to set up basic file sharing on a folder for a single user.

First, make your way to a Terminal window, and install Samba:

sudo apt-get install samba

This will download the Samba files from the Ubuntu repositories and install them. Once Samba is installed, you’ll need to create a Samba password for yourself:

sudo smbpasswd -a USERNAME

(USERNAME, of course, being your username.)

Type a password of appropriate strength twice (utilizing uppercase, lowercase, numbers, and punctuation). Once that’s done, you’ll need to edit the /etc/samba/smb.conf file, Samba’s configuration file. Start by making a folder named ‘test’ on your Desktop; we’ll use that for the shared folder. Next, make a safe backup copy of the original smb.conf file to your Desktop, in case you make a typo:

sudo cp /etc/samba/smb.conf ~/Desktop

Now use your text editor of choice to edit smb.conf:

sudo gedit /etc/samba/smb.conf

(Gedit will probably be the easiest due to the GUI; but you can use vi or emacs just as readily.)

Once smb.conf has loaded, add this to the very end of the file:

path = /home/USERNAME/Desktop/test
available = yes
valid users = USERNAME
read only = no
browsable = yes
public = yes
writable = yes

(Note that there should be no spaces between the lines; depending on your web browser, it might render this post with extra spaces between the lines.)

This will share the test folder on your Desktop, and give your username, and only your username, permissions to both read and write. Save the changes you have made to smb.conf, exit the text editor, and restart Samba:

sudo /etc/init.d/samba restart

Once Samba has restarted, you’ll need to test it. Try accessing the shared folder from another computer on your LAN (to start, it would probably be easiest to access it by IP address). If you can read/write to the folder after entering your username and password, you have set up Samba correctly.

This entry was posted in Linux. Bookmark the permalink.