VectorLinux

The nuts and bolts => Networking & Security => Topic started by: StrayBit on March 02, 2009, 08:50:37 am

Title: Linux-to-Windows file sharing
Post by: StrayBit on March 02, 2009, 08:50:37 am
Thanks MOE-lnx for Howto: Easy Linux-to-Windows file sharing using thunar.

Everything went well until
Quote
Cannot modify the share:

'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. Wrong Password
even after I created user 'Everyone' with no password and removed a file in that folder owned by root.

The folder is in /home/bruce and I set all permissions to it and its contents to read-write.  Where do I go from here?

edit: sorry! I thought I was in the Networking area :'(
Title: Re: Linux-to-Windows file sharing
Post by: M0E-lnx on March 02, 2009, 08:55:29 am
Did you create a new user account ?

You shouldn't need to do that..
if you need any user accounts at all it should be in the samba server .. you can make these using this command

Code: [Select]
smbpasswd -a <your_user_name>
Try that and let me know
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 02, 2009, 09:16:04 am
I had added user everyone.  I'll remove it.

Tried
smbpasswd -a bruce
and
smbpasswd -a everyone

no change.  And I did verify that smbd and nmbd were running.
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 02, 2009, 09:21:33 am
edit: sorry! I thought I was in the Networking area :'(

Moved to appropriate location  :)
Title: Re: Linux-to-Windows file sharing
Post by: M0E-lnx on March 02, 2009, 10:03:32 am
can you gimmie the details of what you're doing?
I just did this
Home -> create new directory ("net usershare")
right-click net usershare -> share -> apply -> Ok
everything works here.

At what point did you get this error?
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 02, 2009, 10:59:13 am
Thanks nightflier.

~/grandfatherclock/ was created when I (as user) extracted grandfatherclock-1.0.1.tar.gz.  At the moment, it is the only folder in my home directory.

right-click  grandfatherclock -> properties -> share check all 3 boxes -> Apply -> "Share name too long. Some old clients may have problems to access it, continue anyway?" Ok ->
Quote
Cannot modify the share:

'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. Wrong Password

I also tried creating a new folder, on applying share, I got "Thunar needs to modify some permissions" (or some such) which I Ok'd then I get
Quote
Cannot modify the share:

'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. Wrong Password
Title: Re: Linux-to-Windows file sharing
Post by: M0E-lnx on March 02, 2009, 11:45:33 am
I wonder where thie "Everyone" string is coming from...
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 02, 2009, 12:41:35 pm
That was appearing even before I created that user - in fact, that's why I did.
Title: Re: Linux-to-Windows file sharing
Post by: M0E-lnx on March 02, 2009, 01:23:39 pm
My wild guess is that there is something wrong with your samba setup... I've never seen that
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 02, 2009, 02:08:55 pm
I haven't found a method to mount the shares from Windows in VL6.  In 5.9 I used pyNeighborhood and vlsmbmount.  I do, however, have the Windows machine mounted via a cifs in fstab.  I'm starting another topic on nfs errors that I'm getting on both machines.

One possibility, I suppose, would be to reinstall 6.0.  One thing I noted with my 5.9 cd, however, was that every time I installed, I had a different set of issues - even on the same machine!
Title: Re: Linux-to-Windows file sharing
Post by: newt on March 02, 2009, 03:11:13 pm
May be totally irrelevant:
'Everyone' is a default group for most windows versions.  Perhaps this is somehow coming into play when trying to set appropriate network share persmissions on straybits system since his network contains windows workstations, but not on moe's which doesn't contain windows workstations (is that true moe?). Then again, maybe I'm wayyyyyy out in left field :D
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 02, 2009, 05:09:31 pm
Not familiar with how Thunar interacts with Samba, but I did do some testing with vlsmbmnt in 6.0 Std. To make it work, I had to install "bind" and add or modify these files: http://cincinnatix.com/vectorlinux/nightflier/vlsmbmnt-files.tlz
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 03, 2009, 01:47:22 pm
I find that vlsmbmnt is allready installed.  Since I didn't see it in the menu, I had assumed it wasn't.
Quote
root:# vlsmbmnt
Rescan
Warning: Tried to connect to session manager, Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
Mounting [\\HUMAN\WinDos] at [/root/mnt/HUMAN-WinDos]
Thunar: Failed to connect to the D-BUS session bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(thunar:21559): GLib-GObject-WARNING **: Two different plugins tried to register 'TspProvider'.

(thunar:21559): GLib-GObject-CRITICAL **: g_type_add_interface_dynamic: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(thunar:21559): GLib-GObject-CRITICAL **: g_type_add_interface_dynamic: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
\\HUMAN\WinDos is now installed mounted, vlsmbmnt message box did not reappear, and the command prompt did not return (I should have end the command with a '&'?

I also attempted to put it into the menu but the menu editor only showed half or less of the menu and the entry did not appear in it - perhaps I need to log out and back in?

Also, I find it odd that the Epson Stylus C60 attached to this machine (Compaq) is listed as being on Human???
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 03, 2009, 02:04:28 pm
I tried vlsmbmnt from the cli again, this time with out su.  Worked like it is supposed to with out the extra errors.  One nice thing is that the cli also reports what is happening.
Title: Re: Linux-to-Windows file sharing
Post by: stretchedthin on March 03, 2009, 02:22:47 pm
Sounds like you installed nightflyers package, otherwise you shouldn't have been able to launch vlsmbmnt at all without being root.
Looks like you were generating the same error I was.
It's easy to put nightflyers package into the filesystem, I made a video tutorial (because thats the way I roll)
http://www.opensourcebistro.com/Tutorial/VL60/Trouble-Shooting/sambafix/sambafix.htm (http://www.opensourcebistro.com/Tutorial/VL60/Trouble-Shooting/sambafix/sambafix.htm)
Hope it helps.
PS, I still was not able to get the thunar-shares-plugin to do it's thing.  So if you do let me know.
Ken
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 03, 2009, 02:44:28 pm
I saved the file to my home folder and expanded it there.  When I went to move it to /sbin is when I discovered it was already there.  His comment on bind had scared me off from using one of the machines to be my router - especially when I found that I had a Linksys router.  In other words, I have no idea what to do about bind.

I had no problem installing thunar-share.  When I right-click -> properties, the tab is along the top just past permissions.  The user must be the owner of the folder and Samba must be running for it to work.  So far, Samba is NOT starting on re-boot so I have to start it manually.  With all of that I had another problem when I tried to share the folder.
Title: Re: Linux-to-Windows file sharing
Post by: caitlyn on March 03, 2009, 02:46:21 pm
samba is not set to start by default in VL6.  You should be able to go into vasmCC -> Servcies and choose the appropriate runlevel and check off samba.  Then it should start at each boot.
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 03, 2009, 03:10:38 pm
It was already marked in both run-level 2 and 4.

vlsmbmnt does mount the shares offered but thunar-shares says that it isn't running!

PS: Sorry for my comment on another post.  I felt it was wrong to say that it was a bug. And from my own experiance, even that comment has triggered me to look again.)
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 04, 2009, 08:52:12 am
For the past few days, when I right-click on a directory -> properties -> share the Folder Sharing is grayed-out and in red bottom it says "You may need to install Samba. check your user permissions (usershares group) and re-login.  More info: http://thunar-shares.googlecode.com/"

Followed that link and, among other things found
Quote
Setup Samba

If your are using (X)ubuntu 8.04 or above just check your User privileges after install the plugin. Also install samba and libpam-smbpass.

For non (X)ubuntu users the Samba setup is:
Create a group (must be done as root)

  export USERSHARES_DIR="/var/lib/samba/usershares"
  export USERSHARES_GROUP="sambashare"
  mkdir -p ${USERSHARES_DIR}
  groupadd ${USERSHARES_GROUP}
  chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}
  chmod 01770 ${USERSHARES_DIR}

Use the following /etc/samba/smb.conf (or something similar)

  [global]
  workgroup = WORKGROUP
  security = share
  usershare path = /var/lib/samba/usershares
  usershare max shares = 100
  usershare allow guests = yes
  usershare owner only = yes

Add the samba group to your user (replace your_username by your login)

  usermod -a -G ${USERSHARES_GROUP} your_username

Restart Samba daemons

  /etc/init.d/samba restart

Logout and login your user (your_username)
I was surprised that I had NOT modified smb.conf but I didn't have any windows folders on this machine.  &USERSHARES_DIR already existed. /etc/init.d/samba restart reported no such file or directory so I rebooted the system.

Surprised me that the Restart and Shutdown buttons were grayed out probably as I had the windows machine mounted in my home directory as I also saw difficulty unmounting /home.  After restart, I was able to set the share property.  The file that I created was owned by pcguest!  Possibly as windows is bruce where in VL the user is bruce6.

Also, I have now figured out that '/etc/init.d/samba restart' is '/etc/rc.d/rc.samba restart' in our system.

Checking from my Windows machine, I was able to access this folder, create and save a text document.  Now to figure out how to do the same from the other VL machine as well as keeping this one from using DHCP.
Title: Re: Linux-to-Windows file sharing
Post by: M0E-lnx on March 04, 2009, 10:06:55 am
A couple of things... your smb.conf gets patched by my package and the USERSHARES_DIR also gets created... this was an effort to automate the process...
However,  the way the service is started is different and I wasnt sure if I should have enabled the samba service by default or not.
but you can start the samba server by simply issuing the command "service samba start" at a terminal as root.

The samba start script is actually located in /etc/rc.d/init.d/samba
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 04, 2009, 11:07:55 am
I did have to add the 4 usershare entries in smb.conf.  And I've verified twice now that Samba is enabled in the start up service sets - and found that vlsmbmnt was working.  I'm hoping that having 2 inets sharing eth0 was the reason it was going to the DHCP for an address.  I have to re-boot again to test that.  It is working now from this machine 0 at least I have access to New Folder from Windows.

I now have 3, maybe 4, methods of sharing from Linux:  Samba, exports, and thunar-shares.  Exports isn't working yet - the other machine keeps giving a nfs error.  I'll try from it some more later this afternoon.
Title: Re: Linux-to-Windows file sharing (fusesmb is the answer)
Post by: subgeniusd on March 04, 2009, 11:11:58 am
Hi Vectorites -

I searched the VL and Slack repos for fusesmb but no luck.

I have 2 Zenwalk 5.2 boxes networked with a new Vista (yuck) machine using fusesmb. Not as effortless as advertised, still ended up needing to manually edit /etc/samba/smb.conf including directory mask. But at least it works and keeps working.

I really like VL 6.0 but find it strange that here we are in 2009 still struggling with network sharing. Why is that?

Having the ability to directly share files with Windows users is nice way of introducing them to Linux. Alternatively not being able to connect at all is quite unhelpful. I know from experience it can be a deal breaker.

Adding fusesmb to the repos would eliminate most if not all of these networking issues.

Other then that 6.0 is a very impressive release. Thank you. :)
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 04, 2009, 12:39:13 pm
Yeah!  I've been wondering about that!

Well, it seems I've introduced new problems:  Exit ONLY allows me to log=out, not sutdown or restart!  Also, I have lost sound, even the volume control shows an empty box!  And it's still going to DHCP for address rather than using the static address that inet0 is set for in vasm.

I just installed thunar-shares on the other machine - it replaced my smb.conf!  Fortunately, I had a backup of it so I could replace my shares.

This is getting ridiculous!  I'm about ready to give up on Linux and revert back to Win95 and DOS!  Of course I'll lose most of my internet abilities.  As it stands, the ONLY way I can open a file on one Linux machine is to copy it to Win98 and open it from there on the other machine!  With every thing I've tried, I haven't had a chance to check out some the neat sounding programs available in Linux.

Don't get me wrong!  VL is a good system and if I wasn't jumping from one problem to two others all the time, I would love to learn how to use it and start getting some work out of it.  And the problems are probably my own doing as I have to make do with  computers from the past millennium since I can't afford to purchase the latest and greatest machine  to put on the current version of that other sw that is getting more and more crippled and I can't afford either.
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 04, 2009, 01:16:04 pm
Initially, samba gave me a lot of grief. I tried one GUI app after the other but could not consistently make it work. Once I bit the bullet and learned how to do it using command line it became easy and consistent. That's samba itself, firewalls introduce possible complications but that's a separate issue.

If you would like to try it that way, I'll be happy to offer suggestions.
Title: Re: Linux-to-Windows file sharing
Post by: subgeniusd on March 04, 2009, 09:28:08 pm
Quote
Once I bit the bullet and learned how to do it using command line it became easy and consistent.

I use "smbtree" "nmblookup" smbclient" for network scans and hand edit all the config files so I'm not entirely dependant on a samba gui.

I'm just looking for a handy share browser which is what fusesmb facilitates. Then you just open the folder you made (I just name it Samba) and there's your Workgroup. A rather inelegant solution but it works and that's all that matters.

PCLOS 2007 had a "network places" shortcut on the panel that took you right to your Workgroup after you set it up.(probably a modified Smb4k app).

Quote
If you would like to try it that way, I'll be happy to offer suggestions.
This is a concise Samba how-to for Slackware that covers most of what a home/SOHO networker needs to know and should apply to VL as well.
http://www.linux.com/articles/58593 (http://www.linux.com/articles/58593)

nightflier - Have you any suggestions for finding or making a convenient network share browser? The only reason I was looking for fusesmb is because it came with Zenwalk so I expected to see it in the Vector repos.
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 05, 2009, 05:31:26 am
IMO, vlsmbmnt is the easiest and lightest GUI samba browser/mounter.
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 05, 2009, 07:08:55 am
Whew!  For a while there I thought I had let loose a diatribe last night.  Re-reading it, it sounded pretty tame compared to what I went through afterwards.

Using cli is an option Nightflier, and thank you Subgeniousd for mentioning some of them.  Never knowing what command to issue, and what options to use with it, has been a pain as I could find no brief summary of what to try for what I wanted to do.  So I was left to the gui commands and they didn't always do what I wanted.  For example, I had to use SWAT just to see if Samba was running.  Until this last installation, however, I had to shutdown Seamonkey before I could start it.  Now SWAT and CUPS default to FireFox.  And I've finally found that if I'm root, SWAT allows me to start and stop the daemons and make changes to smb.conf.  I have to be careful of the latter, though, as it will wipe out the comments and maybe other parts in the file.  Usually, I hand edit it.

I'm to the point on this machine that I'm thinking of wiping the disk and reinstalling (I still have a CD drive temporarily hooked to this machine).  I've lost sound (as I said, even the Volume Control is an empty box!). That hurts as the only other machine with sound is Win98 and its getting flaky even with streaming radio.  Short of using the Power Button, I now have to log-out then use shutdown/restart from the login screen.  And I can't get the IP address to stick. VL6.0 is getting its IP from DHCP instead of using the STATIC address.  I have to manually set it through VASM each time I restart.
Quote
root:# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:8b:c6:a2:9c 
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17656 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18669 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10363150 (9.8 MiB)  TX bytes:3587129 (3.4 MiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4044 (3.9 KiB)  TX bytes:4044 (3.9 KiB)

Compaq://home/bruce
root:# vasm
$DCMD --backtitle "$BACKTITLE" --title "$TITLE" --menu "$TEXT" $DIMENSION \
inet0 "DEVICE=eth0, IPADDR=192.168.1.4" \
inetd "DEVICE=, IPADDR=" \
2> $freply
Starting network eth0 as 192.168.1.4/255.255.255.0...
Setting up gateway 192.168.1.1 ...
Compaq://home/bruce
root:# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:8b:c6:a2:9c 
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17915 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18685 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10379531 (9.8 MiB)  TX bytes:3590143 (3.4 MiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4044 (3.9 KiB)  TX bytes:4044 (3.9 KiB)
I may have had to do this once on previous installations.  On this one, every time! Have no idea what else may be affected - probably are some.

I have heard about fuse several times but not knowing what it was, I've stayed away from it.  I see that there is no man page for it.  Google found the SourceForge page but that doesn't tell me much - if I wanted Hello World, I'd use C!

I had great plans for my system six months ago but was warned away from using VL as my router.  Fortunately, I found that I had a router that would handle Broadband access - I just have to reset it up to half a dozen times a day!  So far, I haven't had any luck having a distributed central data storage (both of my 20 GB disks are full though if I had time to sort through them, I think I could free up some space).  I finally got a printer and got it installed on one machine but still can't share it.  And forget programming, at least till next winter.

Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 05, 2009, 08:56:14 am
Samba can be quite confusing. In review, there are two components; server and client.

When you are viewing remote samba shares, you are using a client of some sort (vlsbmnt, fusesmb, pyneighborhood, konqueror etc.). This client sends out a request on the network which discovers the remote shares. When you connect to those, the client provides the username and password to the server. You do not need "samba" (the server) running on your local machine to make this happen.

The samba server offers shares on the local machine for others to use. To create magic, you need a directory with permissions set to allow access by the samba users. Then you need your smb.conf configured to point to that dir, as well as specifying permissions (note that you will be dealing with two sets of permissions). Additionally, the samba users need to be created and have passwords set. These user accounts are in addition to the system user accounts (so again, two sets). Finally, the samba server needs to be started.

All of this can be done with the command line, but on the client side it becomes a chore. In this case I really like KDE's Konqueror. It seamlessly traverses samba shares and does the work for you. I tried the KDE 3.5 packages in VL6 repo, but that functionality is not yet added. May need to wait until SOHO gets underway.

For the server, it is something you don't touch very often. Once configured, it is out of sight, out of mind, so I personally only use manual edits of smb.conf. SWAT confuses me ;) To see if the server is running, issue command "ps aux | grep smbd" in a terminal. Look for something like:
Code: [Select]
root      2125  0.0  0.2  12352  2552 ?        Ss   00:26   0:00 /usr/sbin/smbd -D
root      2153  0.0  0.0  12352   880 ?        S    00:26   0:00 /usr/sbin/smbd -D
1000      2627  0.0  0.2  12372  2656 ?        S    08:10   0:00 /usr/sbin/smbd -D
1000      2628  0.0  0.2  12372  2652 ?        S    08:10   0:00 /usr/sbin/smbd -D
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 05, 2009, 09:10:01 am
I also prefer to use static IP addresses. One less daemon (dhcpcd) running in the background. Normally, using VASM once takes care of it, but when that doesn't work, here is an alternative approach:

Assumptions: Your internet gateway and nameserver is 192.168.1.1 (typical for DSL and cable modems). You want your box to use eth0, address 192.168.1.100. Modify as needed.

- First, use vasm to delete all inets.
- Make sure your /etc/resolv.conf file contains a line like this:
Code: [Select]
nameserver 192.168.1.1- Add the following lines to /etc/rc.d/rc.local:
Code: [Select]
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.254 up
route add default gw 192.168.1.1

Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 05, 2009, 11:35:36 am
resolv.conf keeps reverting to this
Code: [Select]
# Generated by dhcpcd for interface eth0
search ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
nameserver 64.13.40.5
nameserver 64.13.115.12
after adding the line you mentioned which I have occasionally used
Code: [Select]
# Generated by dhcpcd for interface eth0
search Linux.net
nameserver 192.168.1.1
nameserver 64.13.40.5
nameserver 64.13.115.12
I have my doubts about its effectivness, however, the only time it has an entry is after some machine gets an IP from it and then it only lists the IP and mac address, the name is blank unless it was a win machine making the request.  (That is a Linksys Wireless Access Point BEFW1154 Cable/DSL router)  Its DHCP assigns address 100-150.  This machine is 4.

For once, the login screen wouldn't let me restart, it was frozen for a long time.  I had to work the power button.  Once I got back, this note file and rc.local had the changes but not resolv.conf.  Trying again...  This time it stuck.  But
Code: [Select]
bruce:$ /sbin/ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:50:8b:c6:a2:9c 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1321 (1.2 KiB)  TX bytes:10836 (10.5 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:300 (300.0 B)  TX bytes:300 (300.0 B)
I still had to start it from vasm.
Title: Re: Linux-to-Windows file sharing
Post by: subgeniusd on March 05, 2009, 12:52:52 pm
Hi nightflier - If you think I should start a separate thread I will. But since StrayBit and I share some very similar networking issues perhaps it's actually better to keep it here.

 
Quote
Additionally, the samba users need to be created and have passwords

I've never had to create specific samba users or set passwords before. Not on a home lan.


Currently I only have one OS installed on each computer. The Compaq is the Vector box. I duplicated the same smb.conf settings I used with the Zenwalk box. And I'm trying this Samba connection with one other computer - the new Vista box.


#=========== Global Settings====================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name
   workgroup = ATLANTA

# server string is the equivalent of the NT Description field
   server string = Compaq

# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
   security = share

# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 50

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
   local master = no

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
   domain master = no

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
  preferred master = no

#======== Share Definitions =================

[SharedDocs]
   path = /home/danielh/SharedDocs
   comment = SharedDocs
   guest ok = yes
   public = yes
   writable = yes
   printable = no
   create mask = 0777
   directory mask = 0777


vector:/~
danielh:$ testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[SharedDocs]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
   workgroup = ATLANTA
   server string = Compaq
   security = SHARE
   log file = /var/log/samba.%m
   max log size = 50
   preferred master = No
   local master = No
   domain master = No

[SharedDocs]
   comment = SharedDocs
   path = /home/danielh/SharedDocs
   read only = No
   create mask = 0777
   directory mask = 0777
   guest ok = Yes




This is the result from vlsmbmnt:

vector://home/danielh
root:# vlsmbmnt
Mounting [\\ZENWALK\SharedDocs] at [/root/mnt/ZENWALK-SharedDocs]
mount error: could not find target server. TCP name ZENWALK/SharedDocs not found
No ip address specified and hostname not found
Mounting [\\BIGACER\SharedDocs] at [/root/mnt/BIGACER-SharedDocs]
mount error: could not find target server. TCP name BIGACER/SharedDocs not found
No ip address specified and hostname not found

(I don't understand why IP address needs to be specified and why hostname could not be found)


And this from your post recommendation:

vector:/~
danielh:$ ps aux | grep smbd
root      3234  0.0  0.1  10664  3032 ?        Ss   12:59   0:00 /usr/sbin/smbd -D
root      3238  0.0  0.0  10664  1196 ?        S    12:59   0:00 /usr/sbin/smbd -D
root      4579  0.0  0.1  11004  3124 ?        S    13:30   0:00 /usr/sbin/smbd -D
danielh   7060  0.0  0.0   2060   560 pts/0    R+   14:03   0:00 grep smbd



I know it's always confusing with this box can see those but that one can't see the other one etc.

Simply (and sadly) Vista/BIGACER can see and access everybody (including another computer with other installs I've recently tried). Zenwalk sees and accesses Vector just fine but Vector cannot see or access anybody else.

The Vector firewall is disabled and removed from startup services (I'm behind a Nat router with an SPI firewall).

I installed thunar-shares and the Vector SharedDocs folder is set to Properties-> Permission-> Group:sambashare-> Access:Read & Write.

I like VL with it's great community very much and really want to make this work. I've spent a lot of time trying to get this install networked and will try a little more.

Any suggestions?








Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 05, 2009, 03:30:56 pm
Thanks for the two mask entries, I've added them to my shares.

If you are using Static IPs, you would need to put them in your /etc/hosts.  If the DHCP were also the nameserver (?), I would imagine that would take care of them.  Here is mine
Code: [Select]
# hosts Compaq VL6.0
# For loopbacking.
127.0.0.1 localhost
#
192.168.1.2 Human.Linux.net Human
192.168.1.3 Gateway.Linux.net Gateway
192.168.1.4 Compaq.Linux.net Compaq
192.168.1.5 FreeDos.Linux.net FreeDos
Human and Compaq are VL6, Gateway is Win98 and FreeDos is, er, well, FreeDos.  It has only minimal network at the moment until I get the network stabilized.

Also, I stand corrected.  Several posts backI said the user here is Bruce6.  That is true on Human which is set for triple boot.  Compaq is Bruce.

I started trying some of the commands you gave in an earlier post, specifically 'smbtree' - wow! I like it!  It showed all the samba shares on both Human and Compaq.  I've gotten used to this for Gateway
Quote
   \\GATEWAY              Win98
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine GATEWAY.  Error was ERRSRV - ERRerror (Non-specific error code.)
      \\GATEWAY\IPC$              Remote Inter Process Communication
      \\GATEWAY\C     
It does show the printer on both VL machines??  The other two, I'll have to figure out what to add to them.  vlsmbmnt also shows the same shares but only a single printer correctly on Compaq.

Now to go to the others and see what they show.
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 05, 2009, 03:50:36 pm
Interesting!

Human vlsmbmnt also shows the Epson on itself.  I did verify that CUPS was not publishing it - might be the Load Printers in smb.conf.  Will comment that out and try later.  I double checked on Compaq and it is definitely NOT showing it on Human in vlsmbmnt

Win98 saw the file shares but NOT the printer!

Now to see if I can get the thunar-shares back off.  Hopefully that will restore my sound and Shutdaown/Restart buttons.  Whoa!  I just realized one of the shares I'm seeing on all machines is New Folder that was set with thunar-shares!  Well!  I'll just have to find another way to restore the missing items.  Any suggestions?
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 05, 2009, 06:16:05 pm
Hmm!  I tried opening these shares from the other two machines:  They all failed!  On Human, xterm was telling me "mount error 1 = Operation not permitted".  (Windows never asked - operating as Bruce.  Human asked for Samba User and password - I tried all three.)  I assume thats where that user setup in Samba comes in.  Is that smbpaswd?  And do they need to be the same as a user on the local machine?
Title: Re: Linux-to-Windows file sharing
Post by: subgeniusd on March 06, 2009, 03:42:56 am
StrayBit-

Quote
Thanks for the two mask entries, I've added them to my shares.

Those are wide open permissions that I would only use in a sealed enviroment behind a good router firewall that I periodically check the logs of. Unlikely but Linux systems have been known to host viruses they are immune to. (like Typhoid Mary)

Quote
If you are using Static IPs, you would need to put them in your /etc/hosts

Well I'm on wired DSL/DHCP but the assigned LAN IP addresses are fixed as long as the unit is plugged to router. I've added them all to hosts allow before but it did not solve Samba access problems when they occurred.

Quote
Human asked for Samba User and password


Those should not be necessary unless specified in the smb.conf  file.
"# Use password server option only with security = server".
Just hit enter and continue through. When Samba is fully set up share access is direct and automatic like opening a folder in your home directory.

Quote
And do they need to be the same as a user on the local machine?


I've read in a number of Samba tips from forums etc that for simple file sharing you should always have the same user on all connected machines. Even if that means creating the same user name on all machines specifically for simple share access and file transfer.


I'm convinced Samba represents the merging of technology and Voodoo. I recall 5 or 6 months ago I had an XP, 2 Zenwalk 5.2 and some other distro on 4 machines networked on this same LAN.

Everybody could see and access everybody else except that the 2 ZW machines could not reach each other. Access denied blah blah. The first had been networking fine and I configured the second identically after installing with the same CD.

I eventually worked that out but don't recall if it was a configuration change or a chicken I sacrificed to the Samba fairies.  ;D


Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 06, 2009, 04:27:23 am
I've usually seen some odd number like 756.  It was the entry that I needed - how it should be entered.

There is a difference in function between hosts and hosts.allow:  hosts is used to get the IP of a remote machine from a look-up, hosts.allow is checked to see if the remote machine is allowed access to this machine.  If it is not in hosts.allow then host.deny is checked to see if it should be denied access.  Here are mine
Code: [Select]
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided by
# the '/usr/sbin/tcpd' server.
#
# Version: @(#)/etc/hosts.allow 1.00 05/28/93
#
# Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org
#
#
ALL:192.168.1., 192.168.0., 127.0.0.
# End of hosts.allow.
and
Code: [Select]
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# Version: @(#)/etc/hosts.deny 1.00 05/28/93
#
# Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org
#
#
ALL:ALL
# End of hosts.deny.
I used the first one when my network was all Win.  For a while, my local IPs were assigned by my router in the range of 192.168.1.100-150 and did work until the machines were started in a different order.

I noticed Samba didn't seem to care who the user was.  All three that I tried used the same password so I didn't know about that part.

I started out having the same users in the same order on each installation but crashed it when two versions shared the same /home.  Last Fall I was wanting to have a central home shared by all VLs but couldn't find out how to implement that.  (Disk space is a premium for me and not all boxes allow multiple drives.)

There are times that I think I should run out and get the fatted calf  ;D
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 06, 2009, 05:33:00 am
@ straybit - Manual IP: If dhcpcd is running, it will overwrite /etc/resolv.conf. That's why I said use vasm to remove all inet entries. If you know your ISP's dns servers, using those will work. Or you can use opendns: 208.67.222.222 and 208.67.220.220.

For troubleshooting purposes you should try the manual approach from the command line:
Code: [Select]
ifconfig eth0 down
killall dhcpcd
echo nameserver 208.67.222.222 > /etc/resolv.conf
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.254 up
route add default gw 192.168.1.1

If that doesn't work, something weird is going on.
Title: Re: Linux-to-Windows file sharing
Post by: nightflier on March 06, 2009, 05:50:59 am
It is true you can set up samba to accept all users and passwords, similar to XP's approach. If you are fine with that, use these entries in smb.conf:
Code: [Select]
---
"security = share"
----
[SharedDocs]
   comment = SharedDocs
   path = /path/to/SharedDocs
   read only = No
   create mask = 0777
   directory mask = 0777
   guest ok = Yes
   public = yes
   writable = yes
   browseable = yes

It is not a bad idea to start with something like this and then add restrictions as needed.

I never messed with hosts.allow and hosts.deny. Improperly used, they will cut off access not just for samba, but all network apps. The hosts file can be used for some shortcuts to static ip's but it is not necessary for samba operation.
Title: Re: Linux-to-Windows file sharing
Post by: StrayBit on March 06, 2009, 09:00:42 am
Tested thunar-shares on Human (the other VL6) - installation great, shared a folder in home/bruce - great and was able to copy a file with Win98 to it.  vlsmbmnt, however, acted like it did on Compaq when I was root, I had to ^C to get the prompt back.  I still have the restart and shutdown buttons (which I don't on Compaq) but, when logging in, ~/.dmrc can't be opened.  This is solved by resetting the permissions on bruce to not allow others to write, ie read-only.

Removing the check mark for sharing printers in CUPS/Admin solved the issue of the Epson being reported on Human.  (It's on Compaq.)

/home/public (a share in Samba) has read/write permissions to every one but windows couldn't open it - because the folder didn't exist  ???  Created it and set read-write for every one - still no go.  Now where did that restart samba command go?  Found it 'service samba restart'  - Gateway still says it not accessible!

Found that /etc/rc.d/rc.rpc was not executable, set it and activated the services.  Compaq still reports some rpc error trying to mount Human and
Quote
Human://home
root:# mount /mnt/Cmpq
mount.nfs: internal error
No change in Gateway.