LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2012, 11:01 AM   #1
Seb Spiers
LQ Newbie
 
Registered: Mar 2012
Location: Worcester, UK
Distribution: Fedora, CentOS
Posts: 18

Rep: Reputation: Disabled
Question No write permissions on cifs share


Hi There,

I've got a minimal fedora box with a folder mounted to a windows cifs share.

I mounted the share as root and can access it fine as root and write.

If I try and access the shared folder as another user I can read but I cannot write.

If I try to change the ownership to the other user I get permission denied.

Can anyone advise?

Many Thanks.
 
Old 03-12-2012, 03:45 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
post your /etc/fstab

that will help. also did you set visudo to allow your user access to cifs folder. also the user has to have the exact same name on both systems.

ex: on MS Windows computer user name = admin
on the Linux box you will need a user named admin

this will cause much less issues as MS Windows never plays nice with permissions even in an AD pure windows network.
 
Old 03-12-2012, 04:31 PM   #3
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
an example for the /etc/fstab:

Code:
//IP_address/share	<mount_point>	cifs noauto,guest,rw,username=<user>,password=<pw>	0 0
something like that should be in the fstab, then in visudo you would want:

Code:
/bin/mount <mount_point>, /bin/umount <mount_point>
that would be at the end of the user line. remember to have a , and a space between the last entry and the /bin/mount from above.
 
Old 03-13-2012, 06:26 AM   #4
Seb Spiers
LQ Newbie
 
Registered: Mar 2012
Location: Worcester, UK
Distribution: Fedora, CentOS
Posts: 18

Original Poster
Rep: Reputation: Disabled
Hi There Guys,

I mounted the share using mount from a root shell.

As root I can read/write to the share.
I have another user who cant.

So this suggests that the fact the username is different to the windows logon name doesn't matter.

My /etc/fstab contains
Code:
/dev/mapper/vg_ftp-lv_root /                       ext4    defaults        1 1
UUID=f9eee39e-c213-4bd6-9fbf-8340bc7d2c3c /boot                   ext4    defaults        1 2
/dev/mapper/vg_ftp-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_ftp-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
Should I remount the share as the user who'm I wish to access it?

Last edited by Seb Spiers; 03-13-2012 at 06:37 AM.
 
Old 03-13-2012, 07:22 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
as you manually mounted the drive, that is why your user can not access the files fully as you desired. again see what i typed above.
 
Old 03-13-2012, 09:05 AM   #6
Seb Spiers
LQ Newbie
 
Registered: Mar 2012
Location: Worcester, UK
Distribution: Fedora, CentOS
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thanks for you reply,

So I should put
Code:
//servername/DNN	/home/wsi/dnn	cifs noauto,guest,rw,username=*****,password=*****	0 0
into my /etc/fstab file?

Many thanks.
 
Old 03-13-2012, 09:10 AM   #7
Seb Spiers
LQ Newbie
 
Registered: Mar 2012
Location: Worcester, UK
Distribution: Fedora, CentOS
Posts: 18

Original Poster
Rep: Reputation: Disabled
It didn't work
 
Old 03-13-2012, 09:57 AM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by Seb Spiers View Post
It didn't work
did you edit your visudo?

again remember the user has to be able to mount/umount the share. If the user can not then the user will never have full access to the share for rwx
 
Old 03-13-2012, 10:04 AM   #9
Seb Spiers
LQ Newbie
 
Registered: Mar 2012
Location: Worcester, UK
Distribution: Fedora, CentOS
Posts: 18

Original Poster
Rep: Reputation: Disabled
what's visudo? ;\
 
Old 03-13-2012, 10:10 AM   #10
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
visudo is what controls sudo permissions. this is how user gets to run commands with root level permissions. mount and umount are root commands that user normally does not have access to. by using the visudo you can give permissions to a user they dont own in their group.

Code:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root, rx30      ALL=(ALL) ALL
rx30    ALL =(root) NOPASSWD: /bin/dmesg -n 1, /usr/rx30/setroute.pl, /usr/bin/copyconfig.sh, /bin/mount -t iso9660 /dev/dvd /mnt/
dvd, /bin/umount /dev/dvd, /usr/bin/runit.sh, /usr/bin/dvd+rw-format -force /dev/dvd, /bin/mount /dev/dvd /mnt/dvd, /bin/mount -t
iso9660 /dev/cdrom /mnt/cdrom, /bin/umount /mnt/cdrom, /usr/bin/fixprinter
tdsrmtbk ALL=(root) NOPASSWD: /home/tdsrmtbk/getSystemConfig.sh, /home/tdsrmtbk/setRoute.sh
in the above example i bolded the 2 users in that file for the system I copy/pasted from. In the above example rx30 user has the rights to mount and umount the dvd and cdron as well as to copy some system files around.
 
  


Reply

Tags
cifs, fedora, permissions, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Networking 5 01-28-2014 12:33 PM
Mounting CIFS with write permissions alkos333 Slackware 5 03-02-2012 12:16 PM
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Newbie 5 07-09-2009 08:16 PM
RHEL 4 does not recognize file permissions from w3k storage server cifs share rockfx01 Linux - Server 2 07-14-2008 09:22 AM
no write permissions on samba share lrt Linux - Server 5 04-06-2008 07:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 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