WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problem Accessing Working Samba Share  (Read 3092 times)

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Problem Accessing Working Samba Share
« on: September 29, 2010, 08:31:03 AM »
A share on a TC3.1 machine can be successfully accessed without a password from an Lubuntu 10.04 box using a GUI app, Gigolo 0.4.0.  The share cannot be accessed from a 2nd TC3.1 machine or a Windows XP Pro machine.

SAMBA SERVER TC3.1 MACHINE
Installed (OnBoot):
  • filesystems-2.6.33.3-tinycore.tcz
  • samba3.tcz

The partition to be shared is NTFS and is successfully mounted /mnt/sdb1.  All files are correctly listed with ls /mnt/sdb1.

/usr/local/etc/samba/smb.conf has been edited to create a single public share.  For the purposes of troublshooting security is not an issue.

Relevant sections of smb.conf
Code: [Select]
workgroup = WORKGROUP
server string = Samba Server
security = user
log file = /usr/local/samba/var/log.%m
max log size = 50
dns proxy = no
 
###CREATED BY SamK
# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
[public]
   path = /mnt/sdb1
   public = yes
;   only guest = yes
   writable = yes
   printable = no

The Samba daemons are manually started and status verified
sudo /usr/local/etc/init.d/samba start
sudo /usr/local/etc/init.d/samba status

Code: [Select]
smbd is running.
nmbd is running.

smb.conf reports no issues
testparm
Code: [Select]
Load smb config files from /usr/local/etc/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_STANDALONE

[global]
        server string = Samba Server
        log file = /usr/local/samba/var/log.%m
        max log size = 50
        dns proxy = No

[public]
        path = /mnt/sdb1
        read only = No
        guest ok = Yes

The share is published
smbclient --list=server-ipaddress  --user=$USER,%
Code: [Select]
Anonymous login successful
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.5]

        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk     
        IPC$            IPC       IPC Service (Samba Server)
Anonymous login successful
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.5]

        Server               Comment
        ---------            -------
        OFFICEPC             Primary XP PC
        BOX                  Samba Server

        Workgroup            Master
        ---------            -------
        WORKGROUP            BOX


XP PRO MACHINE
Both the Samba server machine and the XP Machine are in the same workgroup "WORKGROUP".  The Samba server is visible to the XP machine as a networked resource but will not allow a log-in.  A password is always requested.


2nd TC3.1 MACHINE
Installed (OnBoot):
  • filesystems-2.6.33.3-tinycore.tcz
  • samba3.tcz

The Samba server is visible to the 2nd TC3.1 machine
smbclient --list=server-ipaddress --user=$USER,%
Code: [Select]
Anonymous login successful
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.5]

        Sharename       Type      Comment
        ---------       ----      -------
        public          Disk     
        IPC$            IPC       IPC Service (Samba Server)
Anonymous login successful
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.5]

        Server               Comment
        ---------            -------
        BOX                  Samba Server

        Workgroup            Master
        ---------            -------
        WORKGROUP            BOX

Manually mounting the share fails (same message from each example)
sudo mount -t cifs //server-ipaddress/public /home/tc/NTFSshare -o user=tc,pass=%
OR
sudo mount -t cifs //server-ipaddress/public /home/tc/NTFSshare -o user=$USER,pass=%
OR
sudo mount -t cifs //server-ipaddress/public /home/tc/NTFSshare
Code: [Select]
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
mount: mounting //server-ipaddress/public on /home/tc/NTFSshare failed: Permission denied



Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Problem Accessing Working Samba Share
« Reply #1 on: September 29, 2010, 09:50:35 AM »
did you try security = share or setting a tc password via smbpasswd?
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Problem Accessing Working Samba Share
« Reply #2 on: September 29, 2010, 10:47:28 AM »
did you try...setting a tc password via smbpasswd?
This is not likely to lead to the answer in this instance as I want access to the share to be passwordless (anonymous).  Additionally, Lubuntu+Gigolo 0.4.0 and TC3.1+smbclient are both able to access the share in this way.

did you try security = share...?
Yes, yesterday I spent quite a while trying with this setting; all attempts were unsuccessful.  I thought I would give it a further try before replying to your post.  This time it works.  I will have to review what I did yesterday that is different to today.

Edit - start
I forgot to add the command used to mount the remote share.  Both of these work:
Code: [Select]
sudo mount.cifs //server-ipaddress/public /home/tc/NTFSshare -o username=user,password=pw
Code: [Select]
sudo mount -t cifs //server-ipaddress/public /home/tc/NTFSshare -o username=$USER,password=%
Edit - end

In any event - thanks for the ideas.

It does leave one question unanswered; how is it that without the need of a password, Lubuntu+Gigolo 0.4.0 can present the share when "security = user" is specified in smb.conf?
  
« Last Edit: September 29, 2010, 11:03:14 AM by SamK »

Offline schultzter

  • Newbie
  • *
  • Posts: 25
    • Blog
Re: Problem Accessing Working Samba Share
« Reply #3 on: November 01, 2010, 03:28:47 PM »
Were you actually able to browse the share and open & edit files or just see the root of it listed?  It may have to do with the public = yes parameter (I'm no expert but I that seemed likely to me). 

Do you know if you have to install the samba3 extension if you just want to be a client?  Or is the filesystems extension sufficient (that's all I have installed on boot)?  I can't try it right now but the error message I get was to the effect my mount target was not in fstab - but I'd really rather avoid using fstab since it duplicates administration (add a share to the server and I have to add it to my TC's fstab).

Thanks,
Headed for the second star to the right and straight on 'til morning...

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Problem Accessing Working Samba Share
« Reply #4 on: November 01, 2010, 07:22:55 PM »
As '$USER' (e.g. 'tc') you can only mount file systems as they are listed in '/etc/fstab', but that can be overcome easily by using 'sudo mount ...'

The 'filesystems-...tcz' extension is in my experience fully sufficient for file sharing, as I usually use something like:
    sudo mkdir /mnt/d-drive
    sudo mount -t cifs //10.0.2.2/d$ /mnt/d-drive/ -o user=WIN_USER,pass=WIN_PW

Obviously you'll have to use your own combination of IP address (or host name),  share name, user name and password). I believe the purpose of 'smbclient' (from the 'samba3.tcz' extension) goes much further than merely file sharing (e.g. browsing of shares, printers, users, etc. on the remote system).

To get a better understanding of the available options I'd suggest to query the man-page (the one over at linux.die.net is too outdated, even though it's likely to show up tops when searching with google).


EDIT: Only now did I scroll up on this page and realised that I'm merely repeating the same command that others have already given. Well, I'll hopefully pay more attention to this in the future.
« Last Edit: November 01, 2010, 07:32:54 PM by maro »

Offline schultzter

  • Newbie
  • *
  • Posts: 25
    • Blog
Re: Problem Accessing Working Samba Share
« Reply #5 on: November 02, 2010, 10:24:41 PM »
Okay thanks, that explains my problem, because I was doing a sudo mount ... but I was trying to simply mount the server - not a specific share!

Is there any way I can do something like:
 
Code: [Select]
sudo mount -t cifs //nas1 /mnt/nas1 -o user=me,pass=mine
so that all the shares the user 'me' has access to are then available under /mnt/nas1 ?  Without having to list each of them individually?  Also because each user has a personal directory on the server so at least one share/sub-directory would be different for each person in my family.  But since we're all running TC as the tc user it really depends on how we log into the server.
Headed for the second star to the right and straight on 'til morning...