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 07-25-2006, 03:59 PM   #1
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Rep: Reputation: 15
fstab mounts Windows share but read only.


In attempt to access my home shared folder on my Windows 2003 Server / Active Directory domain, I've stuck following entry in my /etc/fstab file:

//server/share$ /home/username/domainshare smbfs credentials=/home/username/.credsfile,workgroup=windows.domain.com,defaults 0 0

I can view the folder, subdirectories, and contents, but everything is "Read Only". Is there a parameter I'm missing in the fstab file? I didn't find anything obvious in the man page.
 
Old 07-25-2006, 04:02 PM   #2
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
Try the 0 0 0 0 mask.
 
Old 07-25-2006, 04:04 PM   #3
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
Just to be sure I understand you, you're suggesting I add two more zeroes at the end?
 
Old 07-26-2006, 04:09 AM   #4
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
yeah,, thats right!!
 
Old 07-26-2006, 04:16 AM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
no, that's wrong.
Code:
umask=0000
to the options section would apply that mask, but I don't think that will help you much.
The problem you are having is your mounting it as root so only root would have rw permissions, you can fix this by changing the line to
Code:
//server/share$ /home/username/domainshare smbfs credentials=/home/username/.credsfile,workgroup=windows.domain.com,uid=[username],gid=[username]defaults 0 0
 
Old 07-26-2006, 07:09 AM   #6
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
After trying both suggestions individually and together, the line in /etc/fstab now looks like

//server/share$ /home/username/domainshare smbfs credentials=/home/username/.credsfile,workgroup=windows.domain.com,uid=[username],gid=[username],umask=0000,defaults
0 0

and I still am unable to make changes to this directory or the files in it. More specifically, attempts to delete a file from the command line return:

rm: cannot remove 'filename': Permission denied

Attempts from the Nautilus GUI give me:

Error while deleting

"/home/username/domainshare/filename" cannot be deleted because you do not have permissions to modify its parent folder.

Are there changes I need to make to other files or to the share on the Windows server?
 
Old 07-26-2006, 07:14 AM   #7
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
what do you get if you do
"ls -l [filename]" on one of the files you can't delete?
 
Old 07-26-2006, 07:17 AM   #8
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
ls -l filename
-rwxr-xr-x 1 65535 65535 0 Jul 21 16:19 filename
 
Old 07-26-2006, 07:28 AM   #9
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
well no wounder you can't delete it, for some reason the share is mounted with user ID 65535 (although I dont know why)
Try unmounting the share
Code:
sudo umount /path/to/share
and then try mounting it from the command line
Code:
sudo mount //server/share$ /home/username/domainshare -t smbfs -o \
credentials=/home/username/.credsfile,workgroup=windows.domain.com,uid=[username],gid=[username],umask=0000
and see if that outputs anything and check the permissions again.

you can also try replaceing smbfs with cifs and see if thet helps
 
Old 07-26-2006, 08:57 AM   #10
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
What's the difference between prefacing a command with sudo vs. entering su and the password then entering each command and exiting?

I entered the "sudo umount" command and was prompted for a password. I entered the root password and got a "Sorry, try again." After three failed attempts I was returned to a $ prompt. I tried again with the same results. I know I'm keying it in right; it's the same password I use for Admin on my Windows system, it works for "su", and on the fifth and sixth attempts I keyed it in with a single finger, one character at a time.

I tried again with my user password and received "username is not in the sudoers file. This incident will be reported." Unfortunately, on subsequent attempts I now receive this message instead of a password prompt.
 
Old 07-26-2006, 09:24 AM   #11
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
sudo uses YOUR password, it's used so you can give some users admin rights (to some or all commands) without giving out the root pass.
Sudo also preserves your environment, so you can run GIUs ar root without logging in as root (gksu, kdesu etc. are wrappers for su or sudo depending on how it's setup, on ubuntu its a wrapper for sudo).
Because in ubuntu the root account is disabled by default (though most users enable it right after install, like me) sudo is used to run administrative tasks by asking for the users password and only works if the user is setup in the /etc/sudoers file. sudo really replaces su as you can get a login shell with "sudo -i"

checkout "man sudo"
 
Old 07-26-2006, 09:49 AM   #12
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
Thanks for the sudo answer, but as I noted I get a "username is not in the sudoers file. This incident will be reported." response when I use my password. Would entering the umount and mount commands after entering su and the root password accomplish the same thing, or must I troubleshoot the sudo problem before I can make progress on the read-only share problem?

This is a Red Hat 9 installation, not Ubuntu, if that makes any difference. Since I'm trying to do all of this from the command line, I'm not sure the distro would affect the process.
 
Old 07-26-2006, 10:06 AM   #13
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
All you have to do to resolve the sudo problem would be to add yourself to the admin group, but yes, su followed by the umount & mount commands would work fine. I just like sudo for the convenience since I have it setup so I dont need to enter my password (don't do that unless you have a strong password and know who has access to your box).

so su
Password:
umount /home/username/domainshare
mount //server/share$ /home/username/domainshare -t smbfs -o \
credentials=/home/username/.credsfile,workgroup=windows.domain.com,uid=[username],gid=[username],umask=0000
ls -l /home/username/domainshare/filename

if the user/group are the same unmount it again and use "cifs" insted of "smbfs"
 
Old 07-26-2006, 10:13 AM   #14
Charlie Spencer
Member
 
Registered: Nov 2003
Location: South Carolina, USA
Distribution: Fedora Core 5
Posts: 106

Original Poster
Rep: Reputation: 15
The umount command works cleanly. After entering it, the share disappears.

After keying in the mount command and pressing Enter, the cursor dropped to the next line and has remained there. No error messages, no # or $ prompt, just a cursor blinking at the beginning of a blank line. Hitting Enter a couple of times generates two more blank lines.

If I open a second command window I can cd to the share and view the contents, but

$ rm filename
rm: cannot remove 'filename': Permission denied
$ ls -l filename
-rwxr-xr-x 1 username username 0 Jul 21 16:19 filename

And I've still got the first window open with blinking cursor.

Last edited by Charlie Spencer; 07-26-2006 at 10:18 AM.
 
Old 07-26-2006, 10:25 AM   #15
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
that is strange, it seems that mount isn't finishing whatever it's doing for some reason. Is the share on the server setup to give you read-write access or just read-only?
Also when you mount with "-t smbfs" it's not mount that's working it's smbmount, smb protocol is quite old and is only really here for compatability, cifs is the newer version (I think from XP up windows works with cifs), so maybe see what happens when you try cifs
 
  


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
samba mounts in fstab Zurvan Linux - Networking 5 04-17-2005 11:13 AM
can see but cant read files on windows share, help a newb out! eonicrush Linux - Networking 2 04-11-2005 04:03 PM
One Windows share getting mounted read-only - why? rparkes Linux - Networking 5 01-31-2004 03:07 PM
Compiled RH7.3 to read WinXP NTFS partition, mounts in Console, but can't mount fstab BlackDogg Linux - Newbie 20 08-06-2002 12:15 AM
switching mounts in fstab elpresidente Linux - General 6 07-09-2002 08:54 PM

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

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