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 12-06-2013, 01:18 PM   #1
bakker_ca
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Rep: Reputation: Disabled
Files Read Only when mounting to Windows 7 share


Hello,

I am having a problem wtih accessing files on a Windows 7 share from RHEL 6. I am able to mount the share but when I try to modify the files as a regular user, I get the files are read only. If I open a terminal session and enter as SU, I can modify the files on the share.

When I do an ls -l, the permissions on the files are -rwxr-xr-x. 1 root root. I have tried mounting two ways but neither of them allow a standard user write access to the files.

mount -t cifs -o username=username,password=password //IP-Address/share /mnt/share

mount //IP_address/share /mnt/share -o username=username,password=password,umask=000,exec,rw,users

This is a fresh install without any added packages.

I don't suspect the Windows 7 share as the problem as I can modify files as SU.

Is there something I am missing. I am pretty new to Linux so any help would be appreciated.

Thanks
 
Old 12-07-2013, 06:48 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,891

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Try adding your user id (uid#) to the mount command.
Change this:
Quote:
mount -t cifs -o username=username,password=password //IP-Address/share /mnt/share
To this:
Quote:
mount -t cifs -o username=username,password=password,uid="uid#" //IP-Address/share /mnt/share
where uid# is your user id number. You can get your uid easily in a console. Just enter "echo $UID" (without the quotes).

For an example on mounting cifs shares on Linux, see http://microitblog.com/micro-it-blog...te-permissions
 
Old 12-07-2013, 07:49 AM   #3
Tech7
Member
 
Registered: Oct 2013
Location: Maine
Distribution: BT 5
Posts: 68

Rep: Reputation: Disabled
Are you technically the "owner" of the share directory in the RH system? According to your permissions only the owner has all read, write and execute permissions. The group only has read and execute. Not sure but your issues could be in the permissions department. The setuid will give you the ability to use the shared dir as the owner, or you can try to give your user ownership of the shared directory completely. Overall it is in the RH that the issue resides.
 
Old 12-07-2013, 09:13 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,310

Rep: Reputation: 223Reputation: 223Reputation: 223
it could be also that the ntfs-3g driver is not installed on the Linux box, if it is not installed then shares from Windows will only be read only.

search Google about "ntfs-3g Linux"
 
Old 12-10-2013, 11:00 AM   #5
bakker_ca
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello,

I tried the items everyone mentioned.

Bigrigdriver: I added the uid it gave me when I ran the echo $uid from a terminal window under normal user but it did not help when mounting the share.

Tech7: The owner seems to be the root. I logged in as root and modified the permissions so the others (which I believe is everyone)access as create and delete files. However when I mount it again, the permissions restore back to access files for others. Is that normal? I tried to do the setuid. I found the command chmod u+s (and g+s) filename and tried it on one of the files in share but it did not help. I also tried it on the /mnt/share folder before mounting and then after mounting. After mounting it gave me a permission denied when I ran that command.

jjjcr: From what I red about that, it is for mounting an NTFS HD, which is on a local system, to a mount point. I did try it though. I used the same line mount -t with all the same parameters I used above except I changed the cifs to ntfs-3g and I get no such file or directory for the ipaddress/share.

Would I need to install Samba on RHEL to get this to work?

Thanks for the help
 
Old 12-11-2013, 12:34 AM   #6
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,691

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by bakker_ca View Post
Bigrigdriver: I added the uid it gave me when I ran the echo $uid from a terminal window under normal user but it did not help when mounting the share.
This should work. From the mount.cifs man page:
uid=arg
sets the uid that will own all files or directories on the mounted filesystem when
the server does not provide ownership information. It may be specified as either a
username or a numeric uid. When not specified, the default is uid 0.
You can, by the way, use the id command to get your user ID, or have a look at /etc/passwd.

What precisely do you mean that "it did not help"? Is the mounted file system owned by the user you specified?

Quote:
Tech7: The owner seems to be the root.
Makes sense, see the man page. But it should be owned by another user if you provide the uid= option.

Quote:
Would I need to install Samba on RHEL to get this to work?
Samba is for serving, not mounting files, so probably no.
 
Old 12-11-2013, 01:41 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,310

Rep: Reputation: 223Reputation: 223Reputation: 223
Cool

Quote:
Originally Posted by bakker_ca View Post
Hello,

I tried the items everyone mentioned.

Bigrigdriver: I added the uid it gave me when I ran the echo $uid from a terminal window under normal user but it did not help when mounting the share.

Tech7: The owner seems to be the root. I logged in as root and modified the permissions so the others (which I believe is everyone)access as create and delete files. However when I mount it again, the permissions restore back to access files for others. Is that normal? I tried to do the setuid. I found the command chmod u+s (and g+s) filename and tried it on one of the files in share but it did not help. I also tried it on the /mnt/share folder before mounting and then after mounting. After mounting it gave me a permission denied when I ran that command.

jjjcr: From what I red about that, it is for mounting an NTFS HD, which is on a local system, to a mount point. I did try it though. I used the same line mount -t with all the same parameters I used above except I changed the cifs to ntfs-3g and I get no such file or directory for the ipaddress/share.

Would I need to install Samba on RHEL to get this to work?

Thanks for the help
ntfs-3g is a driver, if this is not installed on your system. You can't either read or write, to an NTFS disk.

You need to install it if you want to mount then read and write NTFS file system.

check out this link: http://www.confignotes.com/2013/05/n...t-on-centos-6/
 
Old 12-11-2013, 08:04 AM   #8
bakker_ca
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello,

I got it working. I had created the mnt/share folder when I was a SU in a terminal window. I deleted the folder as a SU and then created with my logged on user account. I then mounted it with the UID of my standard account and was able to modify the files after.

JJJCR: I did install the ntfs-3g driver. The article you showed me is talking about mounting a from dev/sda3. Isn't that a local hard drive on the system? I am trying to access a shared folder over the network. This is why I don't believe it worked.

Thanks everyone for your help.
 
Old 12-12-2013, 08:22 AM   #9
bakker_ca
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Just as an update. I was able to use the login name for the UID rather than needing to get the uid #.

As for the mount folder I create under SU, after further testing, I was able to change the owner when mounting using the UID of the standard user. I don't know why it did not work when I was first trying it. Maybe I made some error when typing the command.
 
  


Reply


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 Windows share with a space in the share name Suncoast Linux - Networking 1 06-19-2009 10:15 AM
creating files from windows on a samba share gives read-only permissions. lievendp Linux - General 5 12-17-2008 10:55 AM
Mounting windows xp file system, creates mnt point, however, cant read files in share cmd0a0 Linux - Networking 10 04-16-2005 12:28 AM
can see but cant read files on windows share, help a newb out! eonicrush Linux - Networking 2 04-11-2005 03:03 PM
Mounting a usb thumbdrive st windows files can be read qkslvrwolf Linux - Newbie 2 04-12-2004 09:52 AM

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

All times are GMT -5. The time now is 01:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration