Jump to content

Samba trouble


vashfish
 Share

Recommended Posts

I'm trying to make it so that users have r/w access to samba mounts. No matter how I configure it, either mount complains about bad permissons, or smbmount says "Operation not permitted" when a user tries to mount the partition. If I mount it as root, no users have write access. Here is the line from fstab:

 

//anime/c /mnt/anime smbfs user,credentials=/etc/samba/auth.anime.administrator,suid,exec,umask=0,noauto 0 0

 

I made sure that there were read permissions on /etc/samba/auth.anime.administrator. I'm not sure how to configure the other files in the samba directory, though.

Link to comment
Share on other sites

Hi,

 

one solution (there is more elegant ones):

 

edit /etc/samba/smb.conf that way:

 

[global]

....

security = share

....

 

[homes]

....

[a_shared_directory]

path=/home/samba/a_shared_directory

guest ok = yes

writeable = yes

.....

 

Set the owner of /home/samba/a_shared_directory as nobody, nogroup

Now you can read/write in /home/samba/a_shared_directory [edit].....AFTER you have restarted samba:

 

service smb restart

 

(If I remember well)

Edited by roland
Link to comment
Share on other sites

I've got a slightly bigger problem now... I wanted to see if reinstalling samba would fix it. I went to the package manager and removed all of the samba packages (server, client, kde front-end). Then, in my infinite wisdom, I decided to remove all the files in /etc/samba/ :oops: and reinstalling samba didn't put any of them back... Anyway, I ran the samba mount utility in MCC, and it seemed to set it up OK. However, I have three problems now.

 

1: (from before) Only root can mount /mnt/anime (see excerpt below).

2: it isn't causing any immediate problems, but I'm sure the fact that smb.conf and others are missing can't help any, and

3: it asks me for a password (root or otherwise) even though the host computer (win XP) doesn't require one.

 

[vash@bob /]$ su
Password:
[root@bob /]# mount /mnt/anime
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
       No such file or directory
Can't load /etc/samba/smb.conf - run testparm to debug it
Password:
[root@bob /]# ls /mnt/anime
AUTOEXEC.BAT*  CONFIG.SYS*              MSDOS.SYS*      RECYCLER/
Backups/       Documents and Settings/  NTDETECT.COM*   System Volume Information/
BIOSID.TXT*    Downloads/               ntldr*          WINDOWS/
boot.ini*      hiberfil.sys*            pagefile.sys*   WUTemp/
cabs/          IO.SYS*                  Program Files/
[root@bob /]# umount /mnt/anime
[root@bob /]# exit
exit
[vash@bob /]$ mount /mnt/anime
params.c:OpenConfFile() - Unable to open configuration file "/etc/samba/smb.conf":
       No such file or directory
Can't load /etc/samba/smb.conf - run testparm to debug it
Password:
cannot mount on /mnt/anime: Operation not permitted
smbmnt failed: 1
[vash@bob /]$

Link to comment
Share on other sites

I mount samba mounts as a normal user all the time, and I don't use "mount -t smbfs..." or whatever. I just use "/sbin/mount.smbfs3..." As long as that normal user has rwx permissions to the local folder you are mounting to, and exists via the smbpasswd creation tool, all should be well.

Link to comment
Share on other sites

I mount samba mounts as a normal user all the time, and I don't use "mount -t smbfs..." or whatever. I just use "/sbin/mount.smbfs3..." As long as that normal user has rwx permissions to the local folder you are mounting to, and exists via the smbpasswd creation tool, all should be well.

I agree I think the prob here is there is no smbpasswd set.

 

hence my earlier smbpasswd -n <user> suggestion

Link to comment
Share on other sites

OK. I've tried all that now, and it still doesn't work properly. Here is all (AFAIK) of the relevant info:

 

Windows XP computer:

Name: anime

Workgroup: NEATOPIA

Simple file sharing: off

Shares: C:\ = "C" (FAT32, so no security)

Guest account: enabled, full permission, no password

Other accounts: no password.

 

Linux computer:

 

Here is my /etc/samba/smb.conf (stripped of comments):

[global]
  workgroup = NEATOPIA
  server string = Bob (Linux)
  printcap name = cups
  load printers = yes
  printing = cups
  printer admin = @adm
  log file = /var/log/samba/log.%m
  max log size = 50
  map to guest = bad user
  security = share
  encrypt passwords = yes
  smb passwd file = /etc/samba/smbpasswd
  username map = /etc/samba/smbusers
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  dns proxy = no

[homes]
  comment = Home Directories
  browseable = no
  writable = yes

[anime]
 path=/mnt/anime
 guest ok = yes
 writeable = yes

[printers]
  comment = All Printers
  path = /var/spool/samba
  browseable = no
# to allow user 'guest account' to print.
  guest ok = yes
  writable = no
  printable = yes
  create mode = 0700
  print command = lpr-cups -P %p -o raw %s -r   # using client side printer drivers.

[print$]
  path = /var/lib/samba/printers
  browseable = yes
  write list = @adm root
  guest ok = yes
  inherit permissions = yes

[pdf-generator]
  path = /var/tmp
  guest ok = No
  printable = Yes
  comment = PDF Generator (only valid users)
  print command = /usr/share/samba/scripts/print-pdf %s ~%u //%L/%u %m %I "%J" &

 

Here is my /etc/samba/smbusers

root = administrator admin
vash = Guest
nobody = guest pcguest smbguest

 

I used smb -n vash to remove vash's password. Also, the permissions/owners for /mnt/anime are "rwxrwxrwx nobody nogroup"

 

Given all of this, here is a transcript (note it is almost identical to the previous one, except that this time it has smb.conf):

[root@bob samba]# mount /mnt/anime
Password:
[root@bob samba]# ls /mnt/anime
AUTOEXEC.BAT*  CONFIG.SYS*              MSDOS.SYS*      RECYCLER/
Backups/       Documents and Settings/  NTDETECT.COM*   System Volume Information/
BIOSID.TXT*    Downloads/               ntldr*          WINDOWS/
boot.ini*      hiberfil.sys*            pagefile.sys*   WUTemp/
cabs/          IO.SYS*                  Program Files/
[root@bob samba]# umount /mnt/anime
[root@bob samba]# exit
exit
[vash@bob vash]$ mount /mnt/anime
Password:
cannot mount on /mnt/anime: Operation not permitted
smbmnt failed: 1
[vash@bob vash]$ /sbin/mount.smbfs3 //anime/c /mnt/anime
Password:
cannot mount on /mnt/anime: Operation not permitted
smbmnt failed: 1

 

Finally, here is the relevant line from /etc/fstab:

//anime/c /mnt/anime smbfs user,username=Guest,noauto,suid,exec,umask=0 0 0

 

So, I'm now back at the beginning. vash can't mount /mnt/anime, and I also have the new problem that it asks for a password (even for root). If there is any more information that would be helpful, let me know...

Link to comment
Share on other sites

I've really never done the whole "Guest" "nobody nogroup" thing, so that makes it harder for me without putting more effort into it I don't have right now. I usually get that message when I have failed to make the folder I'm mounting to (/mnt/anime in your case) rwx to the specific user I'm using to do the mounting. Even when I open it wide up with a umask of 666, I can't mount to it unless the user doing the mounting is specifically the owner, or an immediate member of the group.

 

What am I saying? I would "su" to root and do a "chown -f normaluser:normalusergroup /mnt/anime" and see if it works then. Of course "normaluser" and "normalusergroup" replaced with real values. Your error message is not coming from Windows, so nothing need be done there. Just work on the *nix side.

Link to comment
Share on other sites

Yep...id go along with everything vdubjunkie says...

you can also try mounting it from a user in *nix too.

i.e. theres no reason except its pointless you cant mount a samba export on the same machine.

 

this is easier for testing....

also open a browsable share! explicitly.... makes life easier....

 

remember to restart samba BETWEEN changing stuff.

otherwise you can go in circles.....

Link to comment
Share on other sites

OK the prompting for password is somewhere in the settings.

What you can do as a workaround and its not a bad security feature is make a group called samba ....

 

(Using your prefered admin tool)

you then add vash .. and whoever to be members of samba

then samba can own the directory!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...