Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-13-2009, 11:39 PM   #1
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Rep: Reputation: 17
How to mount a Windows shared directory and have mount point be owned by nonroot user

I'd like to mount a Windows shared directory in a nonroot user's home directory on a Red Hat 5.3 linux machine.

I'll need to have the mounted directory owner and group be for a specific linux user account, let's say user jdoe, the mount point cannot be owned by the root account. If I use the following /etc/fstab line:

// /home/jdoe/winserver guest 0 0

The share will be viewable but /home/jdoe/winserver will have root:root ownership and I need it to have jdoe:jdoe ownership. It's not enough to have 777 permissions on that mounted directory, I actually need it to be owned by jdoe. Why? Long story but it has to be that way trust me. Does anyone know how I can do that? Thanks!

Last edited by Arodef; 09-13-2009 at 11:40 PM.
Old 09-13-2009, 11:44 PM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
That's done on the windows share server.
Then the regular cifs mount will allow the user access.
Old 09-14-2009, 12:01 AM   #3
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
To amplify what Simon Bridge is saying:
* "ownership" is determined by the SERVER that SERVES the files
* Samba simply "maps" Linux identities. It doesn't *control* them.

So if you want the file owned by "jdoe", by all means - do it. But do it on Windows.

Ideally, you'll also define a Linux user "jdoe", and map the Linux user to the Windows user.

Or maybe you're in an LDAP environment, in which case both Windows and Linux will get the name from LDAP.

"root" needn't (and shouldn't) be part of any of this.
Old 09-14-2009, 12:23 AM   #4
Registered: Apr 2004
Distribution: Centos, Fedora
Posts: 125

Original Poster
Rep: Reputation: 17
Thanks for the replies.

There's no root user on the Windows server, yet the root is showing up as owning the linux mount point and all files/directores in that shared folder when I use that fstab line I have now. Why is that if there is no user named root on the Windows server?

BTW currently the Windows shared folder does not require any username or password to access it, thus the guest option in the fstab.


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
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
Set up rsync to mirror mount on Windows Server to mount point on 2nd internal drive MoMule Linux - Server 4 04-13-2007 09:34 PM
how to mount windows shared folder as normal user lucasm Linux - Software 4 09-28-2006 06:14 AM
Debian normal user cant mount windows shared partition silverstormboy Debian 3 01-14-2005 07:25 AM > Forums > Linux Forums > Linux - Software

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

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