Ubuntu and Samba

by steve on November 29, 2011

So, you’d like to use Samba (a.k.a. SMB – windows file sharing.  More than you wanted to know here.) to connect to your Ubuntu Linux machine and edit files.

Of course you do, it’s a great idea.

This is the place to start: https://help.ubuntu.com/11.04/serverguide/C/samba-fileserver.html

However, you must must configure a directory to share, there isn’t one setup in the Ubuntu example file.  I can’t teach you Samba configuration in a single blog post, but in your /etc/samba/smb.conf:

• Use this as a reference: http://samba.org/samba/docs/man/Samba-HOWTO-Collection/FastStart.html

[name of your file share]
comment = Text people see when they attempt to connect
path = /path/to/the/directory/you/wanna/share

There’s far too many options in smb.conf to cover here, but you’ll need those for sure.

• Now, you must also create a smb user with a password, your existing user accts don’t get access automatically.  Guh!  Did the Ubuntu docs forget to mention that?  D’OH!

sudo smbpasswd -a your_smb_user

Replace “your_smb_user” with the username you’d like people to log in with.  It will ask you for a password, type that in.  For greater security you’ll have an smb username for each person you want to connect to the server.

Let’s say, just for the heck of it, that you’re connecting to an Ubuntu server running in Parallels on your Mac, or over the network.

  1. Find the IP address of the Ubuntu server.  Go System Settings -> Network, it should tell you what the Ubuntu IP address is.
  2. On the Mac in the Finder hit command-k.   In the “server address” field type: “smb://ip_address”
  3. (replace ip_address with the IP address you found up in step 1)
  4. Click Connect
  5. It should ask you for the username and password you defined earlier in this blog post
  6. If it can’t connect, open the Terminal and type “ping ip_address”  (see ip_address note above).
If it doesn’t return something like this:
PING 192.168.5.71 (192.168.5.71): 56 data bytes
64 bytes from 192.168.5.71: icmp_seq=0 ttl=64 time=0.785 ms
64 bytes from 192.168.5.71: icmp_seq=1 ttl=64 time=0.574 ms
64 bytes from 192.168.5.71: icmp_seq=2 ttl=64 time=0.351 ms
64 bytes from 192.168.5.71: icmp_seq=3 ttl=64 time=0.581 ms

Then something is wrong with your network setups and you’ve got some more googling to do.

Well, this is a pretty deep topic.  Hopefully this helps you connect from your desktop to an Ubuntu server!  Knock ‘m dead, Tiger!

 

Comments on this entry are closed.

Previous post:

Next post: