"mount" as a user

fedora-list at jamesplace.net fedora-list at jamesplace.net
Sat Feb 26 07:47:15 UTC 2005


<Snip>
> How do you specify the user that will own the files? Seems like no
> matter what I do root owns them. (From Craig's response) I tried
> specifying 'user' and my own username like this(see after rw):
> tweety   -fstype=smbfs,rw,user,username=jpifer,password=pass
>
> ://192.168.1.20/tweetyroot
>
> OR
> tweety   -fstype=smbfs,rw,myuser,username=myuser,password=pass
>
> ://192.168.1.20/tweetyroot
>
> I'll have to play around with other file systems, like NFS, and see what
> I get.
>
> Thanks,
> James

=== 

To automatically mount an smb file system at boot, I have added the following 
line in my /etc/fstab file. You can specify User and Group ownership by 
number. (Replace "500" with the value correct for your system.) Get those 
from the /etc/passwd and /etc/group files respectivly. 

//10.7.7.20/Data  /mnt/WinXP  smbfs   uid=500,gid=500,credentials=/etc/smb.txt

The "credentials" paramenter points to file with the following format:
username = YourUserName
password = YourPassword

The drawback here is having your UserID and password in plain text file. I at 
recommend:
chmod 600 /etc/smb.txt
chown root:root /etc/smb.txt

So it's at least only readable by root.




More information about the fedora-list mailing list