LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-23-2005, 01:48 PM   #1
TheLinuxRevolution
LQ Newbie
 
Registered: Dec 2005
Location: Peoria, IL
Distribution: Slackware
Posts: 3

Rep: Reputation: 0
smbfs - Can't create files in subdirectories...


Greetings, I'm hoping someone can help...

I have a Slackware 10.2 server running Samba 3.0.20b. When I mount a share with
"mount -t smbfs -o username=user,pass=pass,fmask=777,dmask=777 //server/share /mount/point" (on another 10.2 PC) the mount completes successfully.

Logged in as a user, I can access the mount point and create files and
directories in the root of the mount point. I can also cd into the directories I've created.

But, I cannot create additional files or directories within the directories I created. My problem is that I cannot create anything within subdirectories on my Samba smbmount filesystem while running as a normal user. Creating files and directories within the root of the mount point (as a normal user) works fine.

Logged in as root, I can create subdirectories and subfolders to my heart's content.

Please, if anyone has any ideas on what to do / try, please reply!

Thank you in advance,
John
samba1@thelinuxrevolution.net
 
Old 12-23-2005, 09:07 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
NFS is the natural way to share volumes between UNIX computers. In case you have Windows boxes on your LAN, keep Samba running. Just export the very same directory via NFS for *nix boxes.
 
Old 12-23-2005, 11:23 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You have the permissions for new files masked out.

From the info page for "umask":
Quote:
14.9.7 Assigning File Permissions
---------------------------------

The primitive functions for creating files (for example, `open' or
`mkdir') take a MODE argument, which specifies the file permissions to
give the newly created file. This mode is modified by the process's
"file creation mask", or "umask", before it is used.

The bits that are set in the file creation mask identify permissions
that are always to be disabled for newly created files. For example, if
you set all the "other" access bits in the mask, then newly created
files are not accessible at all to processes in the "other" category,
even if the MODE argument passed to the create function would permit
such access. In other words, the file creation mask is the complement
of the ordinary access permissions you want to grant.
From the man 8 mount manpage:
Quote:
dmask=value
Set the umask applied to directories only. The default is the
umask of the current process. The value is given in octal.

fmask=value
Set the umask applied to regular files only. The default is the
umask of the current process. The value is given in octal.
fmask and dmask are similar to umask, but allow you to set different default permissions for files than for directories. For a world writable network share, it is common to not set the execution bit for files. However, for directories, the "x" bit serves a different purpose. It allows directories to be entered, so you want to have the "x" bit se]t for directories. In other words, it is overloaded.

Also, check that the username/password that your server uses matches your mount command entries.
The [i]man 8 smbpasswd[/i man-page can give you more information on adding users and changing passwords.
Much depends on how samba is configured. You may need to have phony accounts on the server that matches the users on the remote machines.

Last edited by jschiwal; 12-23-2005 at 11:35 PM.
 
Old 12-23-2005, 11:43 PM   #4
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
This is not correct for smbmount, which is what mount uses for SMB file shares:

From the smbmount man page:
Quote:
fmask=<arg>
sets the file mask. This determines the permissions that remote files have in the local filesystem. This is not a umask, but the actual permissions for the files. The default is based on the current umask.
dmask=<arg>
Sets the directory mask. This determines the permissions that remote directories have in the local filesystem. This is not a umask, but the actual permissions for the directories. The default is based on the current umask.
The other thing to keep in mind is that Samba obeys the Linux file permissions. If the regular user can't create files in the subdirectory from the shell, they won't be able to do it from Samba either. Setting the dmask and fmask options on the mount command doesn't change this.
 
Old 12-27-2005, 12:12 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I stand corrected. Sorry for any confusion caused.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 09:18 PM
Unzipping all .gz files in all subdirectories darin3200 Linux - General 10 04-24-2004 09:58 PM
Cannot create Linux softlink on smbfs neqboan Linux - General 0 07-30-2003 02:21 PM
delete files / keep subdirectories? lhorstman Linux - Newbie 2 01-10-2003 03:01 PM
Script For Moving Files In Subdirectories darkmage Linux - General 3 12-17-2002 06:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration