You are not logged in.

#1 2009-09-01 21:27:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

mount ntfs-3g with 700 for one user from the shell [SOLVED]

I'd like to mount an ntfs partition w/ ntfs-3g but only allow access on the Linux side to a single user.  I don't want it mounted in my /etc/fstab however.  I mount it on the fly now from the shell

sudo mount -t ntfs-3g /dev/sdb1 /media/ntfs_data

I know about the uid=xxxx flag that I can include in an /etc/fstab entry, but I can't seem to get the syntax correct for a shell-based mount command.  Anyone?

Last edited by graysky (2009-09-02 07:13:43)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2009-09-01 22:47:08

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

the -o flag is what you use to put in any of those options (ro, uid=, gid=, etc...)

so just add on the -o uid=xxxx

edit: oops you were looking to change uid, not gid

Last edited by Bregol (2009-09-01 22:57:35)


Nai haryuvalyë melwa rë

Offline

#3 2009-09-01 22:52:15

apollokk
Member
From: Please delete me!
Registered: 2009-03-23
Posts: 157
Website

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

Don't mess things up with UUIDS.

Always use clear device names.


/me wants you to detele this account... please delete it.

Offline

#4 2009-09-01 22:59:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

Bregol wrote:

the -o flag is what you use to put in any of those options (ro, uid=, gid=, etc...)

so just add on the -o uid=xxxx

edit: oops you were looking to change uid, not gid

I just want to limit the mount to ONLY a single user so all other users cannot read/write/execute it at all.  If the user's UID is 3010 would the syntax then be:

sudo mount -t ntfs-3g -o uid=3010 /dev/sdb1 /media/ntfs_data

EDIT: that didn't work.  It just assigns my user as the owner, but all others may freely rwx the partition.

Last edited by graysky (2009-09-02 00:26:12)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2009-09-02 03:05:31

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

Maybe try to add the umask option:

-o uid=xxx,umask=022

This should set permissions to 755 on the mount so the owner can do anything, and everyone else can only read.

Edit: to not allow anyone else to read at all, umask 077 should do it.

Last edited by neddie_seagoon (2009-09-02 03:06:07)

Offline

#6 2009-09-02 06:17:13

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

apollokk - you're entitiled to your opinion regarding UUIDs, but it has nothing to do with this thread. The OP is asking about UIDs.

Please read before posting.

Offline

#7 2009-09-02 07:08:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: mount ntfs-3g with 700 for one user from the shell [SOLVED]

@neddie_seagoon -

The following command you suggested worked!

sudo mount -t ntfs-3g -o uid=3010,umask=077 /dev/sdb1 /media/ntfs_data

If I ls -l the mount point, I do indeed get:

drwx------ 1 username root 8.0K 2009-08-20 14:52 ntfs_data

Thank you!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB