Essentially new, have a Samba question

Apr 18, 2013 18:30

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 ( Read more... )

Leave a comment

vortex April 19 2013, 03:38:39 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!...

Reply

tcpip April 19 2013, 07:17:31 UTC
That is one of the best Samba usage mini-tutorials that I have seen. Nice work!

Reply

vortex April 21 2013, 20:48:10 UTC
Thank you!

Unlike most people in the Linux community, I believe in explaining things in "Human" understandable form...

Reply

tcpip April 21 2013, 21:24:23 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.

Reply

fayanora April 19 2013, 07:18:08 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.

Reply

vortex April 21 2013, 20:46:52 UTC
Hmmm.

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...

Reply

fayanora April 21 2013, 21:56:57 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!

Reply

mattcaron August 6 2013, 19:50:09 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.

Reply


Leave a comment

Up