LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-25-2022, 01:54 PM   #1
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Rep: Reputation: Disabled
Why can't I give write permissions to a mount point


I have a mount point that I want anyone who mounts the device to be able to create or write files.

Code:
drwxr-xr-x   6 root root 4096 Aug 25 13:35 ./
drwxr-xr-x  24 root root 4096 Aug 12 06:55 ../
drwxrwxr-x+  3 root root 4096 Apr 13  2020 d/
drwxr-xr-x   2 root root 4096 Jul  2  2020 temp/
drwxr-xr-x   2 root root    0 Aug 24 18:34 x/
drwxr-xr-x   2 root root 4096 Apr 11  2020 z/
If I use
Code:
sudo chmod +777 /mnt/x
Nothing changes.

This is an Ubuntu desktop system and I am the only user.

Ideas?
 
Old 08-25-2022, 01:58 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,842

Rep: Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977
It depends on the filesystem whether it is native i.e. ext, xfs etc. local, remote and if it is ntfs maybe on kernel version.
 
Old 08-25-2022, 02:13 PM   #3
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Original Poster
Rep: Reputation: Disabled
The shared drive is on Ubuntu 18 and shared by Samba. The mounting system is on Ubuntu 20

This is how I am sharing the device:
Quote:
[share]
comment = Steve's Public folder
path = /home/steve/share
create mask=0777
directory mask=2777
read only = no
browsable = yes
guest ok = yes
force group = steve
force user = steve
ntlm auth = true
writeable = yes
public = yes
 
Old 08-25-2022, 02:58 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,715
Blog Entries: 4

Rep: Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951Reputation: 3951
"Local permissions on the mount-point directory" mean nothing: that directory is merely a dummy placeholder. You have to establish permission using the facilities of "whatever has been mounted at that location." Since this is a Microsoft/SMB mount point accessed through Samba, permissions are established on the Microsoft server-side and you should start your explorations with those logs. Samba maps your Linux user-identity to something that the server will recognize, and the server determines what you can do. I recommend that you proceed by reading a lot about Samba and how it relates to Microsoft's somewhat-byzantine security protocol.

As a categorical statement: any remote filesystem that you mount "is the property of" the remote side and operates according to its rules. "Your identity," as seen by the remote side, is what determines the permissions that it will or will not grant. And there are many ways which can be used to establish that identity-mapping, depending on the exact situation.

Last edited by sundialsvcs; 08-26-2022 at 12:08 PM.
 
Old 08-25-2022, 03:43 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,842

Rep: Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977
As posted CIFS/SMB permissions do not map to linux permissions which is why chmod does not do anything.
Because CIFS/SMB mounts are generally single-user, and the same credentials are used no matter what user accesses the mount, newly created files and directories will generally be given ownership corresponding to whatever credentials were used to mount the share which is root. By creating a special group and adding all those users to that group you can mount the share with the gid=XXX to allow anyone in the group to read/write.

https://linux.die.net/man/8/mount.cifs

Usually if someone mounts the share in their file browser it will be automatically mounted as that user. However, it isn't available to the command line without running additional commands.
 
Old 08-25-2022, 04:33 PM   #6
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Original Poster
Rep: Reputation: Disabled
Let me back up two steps...
I have a drive on an Ubuntu system that I want anyone on the local network to be able to mount with RWX permissions.

Is samba and mount cifs the wrong approach?
 
Old 08-25-2022, 04:33 PM   #7
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
I recommend that you proceed by reading a lot about Samba and how it relates to Microsoft's somewhat-byzantine security protocol.
The more I read, the less I know.
 
1 members found this post helpful.
Old 08-25-2022, 05:11 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,842

Rep: Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977
On the Ubuntu 18 PC in the file browser you should be able to right click on a directory and select "local network share", click on the read/write and guest access boxes. Click create share.

On the Ubuntu 20 PC you can access the share from the file browser just by entering smb://server_name/share_name

In addition:
https://wiki.samba.org/index.php/Set...ndalone_Server
 
Old 08-26-2022, 01:37 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,377

Rep: Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755Reputation: 2755
You haven't actually said what OS the other (remote) users are on.
If it's some sort of *nix, then nfs is more usual, but for MSWin clients, then yes, Samba is 'normal'.
 
Old 08-26-2022, 05:01 AM   #10
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,627

Rep: Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518Reputation: 2518
Quote:
Is samba and mount cifs the wrong approach?
Yes. Your posts above indicating you have a server setup on 18.04 with a client on 20.04 so use the Ubuntu documentation at the link below to set it up. It is not dsifficult.

https://ubuntu.com/server/docs/service-nfs
 
Old 08-26-2022, 09:47 AM   #11
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
You haven't actually said what OS the other (remote) users are on.
If it's some sort of *nix, then nfs is more usual, but for MSWin clients, then yes, Samba is 'normal'.
I had been using the samba share mounted on PCs (and mapped to drive Z) for a couple of years. Permissions only became a problem when I tried to mount the drive on another Ubuntu system so that I could pipe data to the shared drive.

So, I think my original question is wrong. I assumed that it was simply a permissions problem.
 
Old 08-26-2022, 09:50 AM   #12
SteveMann
Member
 
Registered: Apr 2020
Posts: 31

Original Poster
Rep: Reputation: Disabled
[QUOTE=yancek;6376207]Yes. Your posts above indicating you have a server setup on 18.04 with a client on 20.04 so use the Ubuntu documentation at the link below to set it up. It is not dsifficult.

I had been using the samba share mounted on PCs (and mapped to drive Z) for a couple of years. Permissions only became a problem when I tried to mount the drive on another Ubuntu system so that I could pipe data to the shared drive.

So, I think my original question is wrong. I assumed that it was simply a permissions problem.

Hmm, I could try sharing the folder with nfs for the Ubuntu computers... Thanks for the tip.
 
Old 08-26-2022, 10:06 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,842

Rep: Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977Reputation: 5977
nfs has its own idiosyncrasies. Another suggestion might be to use sshfs which is a fuse filesystem for sftp. Using automount or autofs would only mount the share when accessed.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB mount point is not shown in /dev entry point garryhk Linux - Software 3 12-12-2012 05:28 PM
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-10-2009 11:23 AM
mount NFS to mount point then share out the mount point ionic_slim Linux - Networking 2 04-20-2008 12:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:30 PM.

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