The nuts and bolts => Networking & Security => Topic started by: dln9 on February 23, 2010, 09:30:25 pm

Title: Samba and VL Light problems
Post by: dln9 on February 23, 2010, 09:30:25 pm
I have VL Light installed.  I also have another computer running Ubuntu 9.10.  I am using SAMBA to have both computers "see" each others directories.  (I use SAMBA because at times I need to include a Windows machine.) 

I am at a loss regarding how to set this up in VL.  I have stumbled across a handful of menu items that seem to be related to getting this setup, but I don't know which I have to do first, or even if I should be doing them all.  I've read a good deal of documentation that I could find, but unfortunately I am still confused regarding what the heck they were talking about. 

On the VL machine, if I go to "Network", and then "Windows Networking", it brings up a window that shows the shared directory on the Ubuntu machine.  When I select the option to mount that Ubuntu machine shared directory, it asks for the user name and password - which I assume is the user name and password on the Ubuntu machine - which I enter.  I then get this error message: 

Error Occured While Mounting

This isn't telling me enough, I don't know what to do next. 

In addition, on the Ubuntu machine, it "sees" the VL machine, but it refers to it as a "SFTP FTP drive", whatever that means.  If I try to open it, I get an error message that says that it cannot mount the drive. 

How do I set this up so it works? 

Title: Re: Samba and VL Light problems
Post by: nightflier on February 24, 2010, 04:39:26 am
An update may fix this. Open gslapt, click Edit > Preferences > Sources tab > check the box for "testing" (probably fifth line down). Let it update. Search for "vlsmbmnt" and install it. It may also upgrade your samba version.

The samba user name and password is not automatically the same as computer login user. On default XP, you can usually just use blank values, or username "guest" and blank password. On Linux, you normally need to create samba user credentials, or make the shares public.
Title: Re: Samba and VL Light problems
Post by: dln9 on February 24, 2010, 06:25:21 pm

I installed the vlsmbmnt from the test repository, but I still have the exact same problem. 

I'm worried that I have some obscure setting set incorrectly, I really don't know what I"m doing with this stuff, so it is very possilbe that I'm failing to do something critical. 

Does anyone know of a place I can look at that give a fairly simple stepby-step guide to getting this working in VL? 

Or, any other thoughts on how I can get this working? 

Thanks again. 
Title: Re: Samba and VL Light problems
Post by: nightflier on February 24, 2010, 06:33:30 pm
Time to use the terminal. Enter the command "smbtree". Just hit enter if it asks for password. What is the output?
Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 12:47:14 am
Oh thank you for helping - I've been going crazy trying to figure this out!  There is so much documentation - seemingly conflicting and confusing documentation - that I didn't know what to do, nor did I know which documentation would apply to my needs, that is still current, or even that I could trust. 

Here is the result of the smbtree command, I ran this on "system4", which is the machine on which VL is running: 

   \\system4         vector linux samba server
      \\System4\stylus-cx4600      epson stylus cx4600
      \\system4\ipc$                    ipc service (vector linux samba server)
      \\system4\lexmark              lexmark
   \\system1         system1 server (samba, ubuntu)
      \\system1\shared stuff
      \\system1\ipc$                    ipc service (system1 server (samba, ubuntu))
      \\system1\print$                  printer drivers

I noticed that the shared directory I wanted set up on system4 - called "shared_stuff" - does not appear. 

Each machine has specially designated directories that I want each machine to be able to access - but no other directories.  Also, each machine has a printer attached that I'd like each machine to have access to.  In each case, I'd like each system to require that the system trying to gain access to it has to enter the user name and password of the host system.  So, for example, if system1 tries to look at the directory on system4, the person on system1 has to know and enter the user name and password for system4. 

I've done *a lot* of fiddling with the web-based samba configuration thingy, but that was emotionally draining.  The opton to make the share be available=yes would never "stick" - it would always revert back to no.  I got other settings to change, so I don't think that I was failing to commit the changes.  But, who knows.  Oh well, maybe that doesn't even matter at this point. 

Anyway - any ideas on where to go from here?  Thanks again. 

(PS:  In VL, the terminal program is xterm.  How the heck does a person copy and paste output from that into something else?  I couldn't figure that out, I had to manually type all the output into this posting.  There must be a way to copy from the terminal to the clipboard - Isn't there?) 
Title: Re: Samba and VL Light problems
Post by: M0E-lnx on February 26, 2010, 04:40:53 am
You really don't need samba to do file sharing between 2 linux boxes. Google for sshfs
Title: Re: Samba and VL Light problems
Post by: nightflier on February 26, 2010, 06:05:43 am
First the easy stuff: To paste to/from xterm, just highlight the text with your mouse, then click the middle button (or mouse wheel) where you want to paste the highlighted text. You can also paste into a terminal with key combination Shift-Insert. Another technique is to re-direct the output of a command to a text file, then open it in an editor. Example: "smbtree > smbtreeoutput.txt".

Effective use of the terminal is a great skill to learn. It is the most accurate and effective way of giving directions in an environment where several different GUI's are in use. There have been many times when I have wished for this option when helping Vista users. Since I stopped using Windows at XP, I don't know where they need to click.

As M0E pointed out, there are more ways of doing this. If you would like to try sshfs, please start a different thread for that.

Staying on samba, I'm interested in finding out why vlsmbmnt doesn't work for you. It is a simple tool that only deals with reading remote shares.

First step: please open a terminal, then issue command "vlsmbmnt". Click through the mounting procedure. Try to use blank values when it asks for username and password. Watch the terminal window for error messages. Copy and paste them into a reply.

Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 08:40:30 am
Here is the ouput you asked to see: 

root:# vlsmbmnt 
Mounting [\\SYSTEM1\shared] at [/root/mnt/SYSTEM1-shared]
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

While doing this, I figured out a few things. 

As you can see, I'm trying to access a shared directory on SYSTEM1.  That shared directory is called

shared stuff

with a space embedded in the name.  When I saw the output in the terminal window, I thought, perhaps that space in the name is part of the problem.  So, I went to the SYSTEM1 machine, changed the name of the directory in question to sharedstuff, and tried vlsmbmnt on SYSTEM4 again to access the sharedstuff directory on the SYSTEM1 machine.  And - it worked.  Also, to access the sharedstuff directory on SYSTEM1 from SYSTEM4, I had to enter the username and password for SYSTEM1, which is what I want. 

Then - I tried to access sharedstuff using the menu item NETWORK >> WINDOWS NETWORKING, instead of going through the terminal.  It did not work.  I assume it did not work because using the menu item I was not logged in as root.   

So, here are my questions: 

1)  Does the output I show above from the terminal tell you something else useful that I am overlooking? 

2)  How do I get the menu item NETWORK >> WINDOWS NETWORKING to work while not root? 

3)  How do I get SYSTEM4 (Vector Linux) to deal with directories on other machines that have spaces embedded in their names?  The other machines - Ubuntu, Crunchbang, openSUSE, Windows - don't have a problem with this. 

4)  From SYSTEM1 (Ubuntu), I am able to see SYSTEM4 (VL) as part of the workgroup, but I can't mount - or even see - the directory in SYSTEM4 that I want to share with other machines.  What do I need to do in SYSTEM4 to make that work?  (I am wondering if that is due to the problem with setting the shared drive in SYSTEM4 to available=yes.) 

5)  Bonus question:  Thanks for the tip about using the middle mouse button to paste stuff.  I did not know about that.  However - One benefit of VL is it is lightweight, so I can use really old hardware.  How do I copy and paste from xterm if I have a really old mouse that has only two buttons on it? 

(To MOE-lnx:  Thanks for the reply.  I have Windows in the mix, that is why I am going with SAMBA, my poor understanding is that in such a case SAMBA is the tool to use.  Is that correct?  Anyway, I already have SAMBA set up and running well on five other machines, I'd hate to change it now just because of Vector Linux.  Besides, even if I were to go with sshfs - whatever the heck that is - I'd still want to figure this out.  Supposedly SAMBA is *supposed* to work in VL, and if it isn't working because something is wrong, I'd like to see it fixed, instead of it coming back to bite me months later in some fashion I don't expect.  It is sort of like, I go to the repair shop to get the radio in my car fixed, I wouldn't be satisfied if they said I could set a boombox on the seat and listen to the radio that way instead of fixing the radio.  Finally, I'll admit that right now I'm all googled-out, I can't start from scratch on sshfs right now.  There is a HUGE problem with Google stuff, and that is that there is no quality control.  I can find lots of documentation out there, but is it any good?  Is it complete?  Is it up-to-date?  Is it good practice?  When you're new to some topic, you're not in a position to know what you're looking at.) 
Title: Re: Samba and VL Light problems
Post by: nightflier on February 26, 2010, 09:14:30 am
There is progress here. :)

1. As you can tell, launching programs from a terminal can provide a lot of useful information. You correctly deduced that the space in the share name was a problem, and fixed that. It also gave me a good bug report, I will look into the issue. No other problems are indicated in that output, though.

2. The latest update to vlsmbmnt should have fixed the mounting issue. Would you try to re-install it using gslapt, then launch it from a terminal as regular user?

vlsmbmnt is bare bones simple, and does not have the capabilities of Ubuntu's file manager. If you want that kind of automation, you can install "kdebase" on Light. It gives you much improved networking capabilites at the cost of some performance loss.

3. To troubleshoot why you can't see any shares on SYSTEM4, post the content of your file "/etc/samba/smb.conf".

4. With a two button mouse, you can emulate a middle button by pressing both buttons at once. This is enabled by adding a line to the "InputDevice" section of the file /etc/X11/xorg.conf:
Code: [Select]
Option “Emulate3Buttons” “true”
Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 09:51:58 am
The option to reinstall the vlsmbmnt package was greyed out, so I uninstalled vlsmbmnt, and then reinstalled it. 

After that, here is what a regular user gets when running vlsmbmnt from the terminal: 

main4:$ vlsmbmnt
bash: vlsmbmnt: command not found

Just for the heck of it, I tried it from the terminal as root, and it still worked.  So, the problem appears to be that I can't run vlsmbmnt when not logged in as root.  (You probably already suspected that.) 

Here are the contents of /etc/samba/smb.conf: 

# Samba config file created using SWAT
# from UNKNOWN (µ·ðcK)
# Date: 2010/02/26 11:52:26

   server string = Vector Linux Samba Server
   log file = /var/log/samba.%m
   max log size = 50
   dns proxy = No

   comment = All Printers
   path = /var/spool/samba
   guest ok = Yes
   printable = Yes
   browseable = No
   browsable = No

   read only = No
   guest ok = Yes
   available = No

   comment = lexmark
   path = /var/spool/samba
   read only = No
   guest ok = Yes
   printable = Yes
   printer name = lexmark
   oplocks = No
   share modes = No
   comment = All Printers
   path = /var/spool/samba
   guest ok = Yes
   printable = Yes
   browseable = No
   browsable = No
Title: Re: Samba and VL Light problems
Post by: bigpaws on February 26, 2010, 10:56:29 am
There is always samba by example.

The next place to start would be the log file

That would give you a clue about the problem. Did you add the
users to the system and the smbpasswd?

Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 11:19:10 am
Thanks for the input, bigpaws. 

I know emails, postings, etc., can easily be misunderstood.  I am glad for your (and others responses), so please know that my following questions are very sincere, don't take them in a bad way. 

I have no idea what "samba by example" is. 

I don't know what is meant by "the log file".  Where does one find it, and what would it contain that would help out? 

When you asked about adding users to the system and to the smbpasswd:  *Which* users did you have in mind?  How (and why) does one add users to a system and to a smbpasswd?  And, what is "the smbpasswd" to which I need to add users?  Anyway, not knowing anything about users and smbpasswd, the answer is, No, I did not add users to the system nor to the smbpasswd.  At least, not knowingly. 
Title: Re: Samba and VL Light problems
Post by: M0E-lnx on February 26, 2010, 11:54:16 am
Whenever I get stuck with something like this, I go back to the default configuration, and I think that's what bigpaws meant by 'samba by exmple'.
You should have a /etc/samba/ or /etc/samba/smb.conf-sample file which has the default configuration.

Remove your edited file, and make a cope of the .new or .conf-sample file (whichever one exists) as /etc/samba/smb.conf

Add a configuration for a shared directory first
restart your samba server
and try smbclient -L localhost
if that shows your shared directory, that means you're in the right path... keep going

otherwise, fix your configuration.
Title: Re: Samba and VL Light problems
Post by: nightflier on February 26, 2010, 11:55:17 am
Okay, you need to enter "/sbin/vlsmbmnt" as regular user. Please try that.

Now, for your smb.conf file, let's start with a very simple one, similar to XP's "simple file sharing":
Add this line to the [Global] section:
Code: [Select]
security = shareChange this section:
Code: [Select]
   read only = No
   guest ok = Yes
   available = No
to this; (don't include my comments);
Code: [Select]
   comment = something                                  <------ optional, whatever
   path = /home/main4/our_stuff/shared_stuff            <------ my assumption
   read only = no
   public = yes
   browseable = yes
The directory /home/main4/our_stuff/shared_stuff must be readable/writable for users.

Save the file and restart samba:
Code: [Select]
/etc/rc.d/init.d/samba restartWait 7 minutes, then try to browse to your VL box.

After you get this working, now add security. Change the line:
Code: [Select]
security = shareto:
Code: [Select]
security = user
Yes, you need to add users and passwords to samba. As root, issue command:
Code: [Select]
smbpasswd -a main4
(enter password twice)

Change the share definition:
Code: [Select]
   comment = something
   path = /home/main4/our_stuff/shared_stuff
   read only = no
   browseable = yes
   create mask = 0666
   directory mask = 0777
   valid users = main4

Restart samba again and test. It should now require username and password.
Title: Re: Samba and VL Light problems
Post by: bigpaws on February 26, 2010, 12:29:27 pm (

This guide is called Samba by Example

This is written by the folks that develop samba


Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 01:32:26 pm
I ran /sbin/vlsmbmnt as a regular user in a terminal.  It worked fine.  Then, I thought, now I'll try running it from the menu.  And it worked just fine.  I don't know why it started working, but now it does work from the menu. 

Just to clarify - vlsmbmnt won't work if the name of the directory on the foreign machine has a space in it - Is that correct? 

Then, I made all the changes you advised in the smb.conf file.  At the end of it all, everything worked great. 

Thank you very much for all the help, you deserve a day off.  Actually walking through this has helped me understand it better.  (And I now understand that smbpasswd must mean the user name and password needed to access the host machine.) 

One more question - Why the wait of seven minutes?  What is taking place, and why does it take so long? 

Thanks very much again. 

(bigpaw - I actually did read through that document, I just didn't mentally connect it with that name when you first mentioned it.) 
Title: Re: Samba and VL Light problems
Post by: nightflier on February 26, 2010, 01:57:18 pm
Glad you made it work.  :)

Yes, looks like vlsmbmnt can not handle spaces in share names. I will try to fix that.

Samba does a lot of talking behind the scenes. When there are several samba servers on the network, they have to agree on who is the master and what shares are available. This can take several minutes.

Have a great weekend!
Title: Re: Samba and VL Light problems
Post by: dln9 on February 26, 2010, 02:11:09 pm
You are going to try to fix the issue with spaces in the names? 

Whoa! I didn't know I was working with the VL designer/programmer.  Now I'm really honored you took time to help me. 

Thanks again. 
Title: Re: Samba and VL Light problems
Post by: GrannyGeek on February 26, 2010, 05:20:05 pm
Besides, even if I were to go with sshfs - whatever the heck that is - I'd still want to figure this out. 

The following is no solution to your problem and I'm putting it here just because it adds something important for people who want to network their Linux computers and not go through the issues that often pop up with Samba. I think the easiest way to network Linux computers is through nfs. I don't know what sshfs is, don't want to know, in principle avoid anything with "ssh" in the name. ;-)  That's also how I feel about emacs and any incarnation of  TeX.

I have a HowTo here:

It's easier to do than to describe and once you have the nfs network set up, you can simply copy the related files in /etc that I mention to another VL installation with a few minor and obvious modifications. It takes me about two minutes to get the network going when I'm setting it up in a new partition. I don't automount the networked partitions (though it can be done) but a simple mount command works instantly when you want access to another computer on your nfs network.

For networking with Windows, Samba is by far the best choice. It is possible to share a printer connected to a Windows machine without using Samba. KDE's Konqueror can work quite well for some file sharing without Samba. I think it depends on how much and how often you need access to a Windows partition.
Title: Re: Samba and VL Light problems
Post by: nightflier on March 01, 2010, 02:29:34 pm
Whoa! I didn't know I was working with the VL designer/programmer.
I'm just one of many volunteers.  :)

Here is a new package which I would like for you to test. If you feel up to it, run these commands in a terminal:
Code: [Select]
(enter your root password)
upgradepkg vlsmbmnt-1-noarch-3vl60.tlz

Now try "Windows Networking" and see if it will handle shares with spaces in their names.
Title: Re: Samba and VL Light problems
Post by: PerunMan on March 30, 2010, 06:24:15 pm