Log in

Previous Entry | Next Entry

Essentially new, have a Samba question

I've been using Ubuntu for a few months, but still I'm essentially new. I'm not a programmer at all, just someone who got tired of Windows constantly effing up even though I ran frequent virus scans and stuff.

I like Ubuntu very much, so far... but one problem I have is my laptop (which dual boots Windows/Ubuntu) can't network with my desktop PC (which runs Windows 7) when it's on the Ubuntu side. I tried, at first, installing the packages that it said were missing. I tried many times, and they refused to install. That was about a month ago.

Today, being unable to remember what it wanted me to install, I looked it up on Google and recognized Samba as one of the things it wanted me to install. So I followed the directions and managed to get it to install. And now I'm stuck. I don't know how to use Samba, I don't remember the other thing it wanted me to install, and the instructions for what to do with Samba might as well be in Greek for all the sense I can get out of them.

So, I need someone to point me at (or provide me with) what to do, that's written for the everyday person. Samba for dummies, I guess you could say.

Thanks in advance!


( 8 comments — Leave a comment )
Apr. 19th, 2013 03:38 am (UTC)
What do you want to do with Samba?

Samba is used for file sharing to/from Windows OS.
To share a folder from Ubuntu, open Nautilus (the default file manager in Ubuntu), right-click on a folder and select "Sharing Options". Put a check in "Share This Folder" and give it a short description that will appear in Network Browser in Windows. Check "Allow users to create and delete files in this folder" if that's what you want. Then click "Create Share" to finish that operation. Now you should be able to see that folder in Windows File manager and log in with a user account that you have on your Ubuntu PC. Be sure not to share a folder that normally requires "root" access. "/home/username", "/var/www" should be ok for standard access though if you try to access "/home/username" with a different username, you will have to add that username to a group that has permissions to access that folder. Linux is a stickler for file/folder permissions, it wouldn't hurt to read up on that as it will save you many headaches.

To access a Windows Share, open Nautilus (the default file manager in Ubuntu), press "ctrl+l" and a bar will open at the top. Type in "SBM://" followed by the IP address or windows name for the pc you want to connect to. Press "Enter". You will get a list of shared folders/printers on that pc. Double-click on the folder you want to access and a pop-up will let you enter login information for that folder.

You can also access shares with samba using the command line, but that is beyond my knowledge at this point as I use Nautilus almost exclusively. You can also access files using Remote Desktop, VNC (remote desktop like), Telnet, ssh, and other ways, but the Nautilus is the easiest.

Hope that helps!...
Apr. 19th, 2013 07:17 am (UTC)
That is one of the best Samba usage mini-tutorials that I have seen. Nice work!
Apr. 21st, 2013 08:48 pm (UTC)
Thank you!

Unlike most people in the Linux community, I believe in explaining things in "Human" understandable form...
Apr. 21st, 2013 09:24 pm (UTC)
The best thing, I think, is that was pitched at the user's level of expertise and request: written for the everyday person.

The reason I make this comments is that I've been involved in Linux training for several years now (and currently doing postgrad adult education) and it's all too easy to slip into assumptions of what relative experts are familiar with.
Apr. 19th, 2013 07:18 am (UTC)
Well the thing is, I don't have Internet at home, but I do have a local wifi network that allows sharing between computers. Between Windows machines, it's fairly simple (usually), but Ubuntu can't currently network with Windows machines because it needed Samba and something else I've forgotten, to do it. I want to be able to access shared drives, like my 2 TB external drive, or get access to, say, the "public" folder on my Windows machine, to be able to send files from the Ubuntu machine to the Windows machine.
Apr. 21st, 2013 08:46 pm (UTC)

If your Windows pc and Linux pc are on the same TCP/IP network (as in, if the first three numbers of the ip address are the same ie. 129.25.25.x on the Windows machine, 129.25.25.y on the Ubuntu machine, or 10.0.0.x and 10.0.0.y or whatever your network scheme is), then Samba should work as long as you have it configured as above. Just make sure that the user you use to login to the shared folder has permissions to read and write to that folder.

There may or may not be an issue with sharing with sharing folders if your external drive is a USB drive and you unplug it. I'm not sure because I just plug my USB drives into each pc, it's much faster than transferring over the network...
Apr. 21st, 2013 09:56 pm (UTC)
I'd just plug the drive into the laptop, too, but the cord won't reach, and I can't afford to buy another cord. Also, if I try to play music from the drive on the laptop even when it's connected straight to it, the laptop goes really slow and sometimes skips around.

Of course, that sometimes happens on the Ubuntu side anyway, even for files on the laptop itself, but whatever. I wanted to be able to have both machines using the external 2 TB drive at the same time (and since neither has an esata port...). Or, barring that, to be able to access the hard drive of the Windows PC to send files into its Public directory.

I've saved your directions and will try them when I get home. Thanks!
Aug. 6th, 2013 07:50 pm (UTC)
I can fill in command-line gaps, as I use that, not Nautilus.

To mount CIFS (formerly SMB) filesystems under Linux, you need to do the following:

1. Make a directory as an "anchor" to attach the filesystem to (this is called a "mount point" and works like drive letters in Windows), ie: mkdir ~/windows

2. Issue the following command: sudo mount -o user=$USER //servername/sharename ~/windows, replacing servername with the name of the windows machine, and sharename with the name of the share you wish to mount. The $USER is literally that - it will use the Linux username to log you in to Windows, which assumes they are the same. If not, you can replace $USER with the name with which you log in to Windows. Note that it will prompt for your Windows password in order to mount the share.

3. To unmount the drive, it's just sudo umount ~/windows

Other notes:

1. I tend to wrap this in a script for convenience.

2. man mount.cifs will list a pile of options.
( 8 comments — Leave a comment )