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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-30-2003, 11:50 AM
|
#16
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Pulled out the man for ya, here's the terminology it uses:
Code:
uid=value and gid=value
Set the owner and group of the files in the file
system (default: uid=gid=0).
HTH
Cool
|
|
|
06-30-2003, 04:25 PM
|
#17
|
LQ Newbie
Registered: Jun 2003
Distribution: Redhat 8 with kde 3.1.1
Posts: 4
Rep:
|
DOH. Thanks
|
|
|
06-30-2003, 04:53 PM
|
#18
|
Member
Registered: Jun 2003
Location: Montréal, Québec
Distribution: red hat 9
Posts: 84
Original Poster
Rep:
|
thx
|
|
|
07-01-2003, 05:41 AM
|
#19
|
Member
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106
Rep:
|
Quote:
Originally posted by MasterC
It specifies that the drive is mounted as owner user, check your /etc/passwd file and see which user is uid500
Similar with gid in /etc/group
Cool
|
Hi master,
I do not have problems mounting my vfat partition, works as always... but I have a security question: is it possible to set rights when mounting -- i.e. not only setting UID and GID but also do something like chmod -R o-rwx *, which of course does not work on vfat partitions... but are there possibilities to set this when mounting???
I am asking because I gave accounts to my computer to sime frineds and they should not be able to see my vfat partition...
|
|
|
07-01-2003, 06:41 AM
|
#20
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Sure, assuming you only want root to see it (you could do this several ways...) you can use:
/dev/blah /mnt/blah vfat users,uid=500,gid=500,umask=077,rw 0 0
However, that would be pointless. A better way:
Assuming your "friends" are in group users, and you don't want them to be able to see it, simply mount with:
/dev/hdx /mnt/blah vfat defaults,uid=0,gid=0,umask=077,rw 0 0
This would only allow root to see it. Now if you had these same users in a specific group, and maybe you and a "special" user in another "special" group, say, l33t is the group name, and the gid for that group is 200, then:
/dev/hdx /mnt/whatever vfat users,noexec,uid=0,gid=200,umask=007,rw 0 0
This would be ideal. Then, only root and the users that you have in group "l33t" with the gid of 200 would be able to do things on this drive. The umask of 0 is equal to a chmod of 7, and the opposite for 7. If you wanted other things, such as to give them write access, but no read (there are times when this could be valuable...) simply choose the correct umask, which is proportional to the chmod equivilent:
7=0
6=1
5=2
and so on.
Cool
|
|
|
07-01-2003, 07:43 AM
|
#21
|
Member
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106
Rep:
|
Quote:
Originally posted by MasterC
Now if you had these same users in a specific group, and maybe you and a "special" user in another "special" group, say, l33t is the group name, and the gid for that group is 200, then:
/dev/hdx /mnt/whatever vfat users,noexec,uid=0,gid=200,umask=007,rw 0 0
|
This really seems to be ideal - then I can mount as user=myself (UID500) and give me rw access and for a special group (e.g. l33t ) only r access...
Should be:
/dev/hdx /mnt/whatever vfat noexec,uid=500,gid=200,umask=027,rw 0 0
This seems to be it
I'll try when I'm at home in the evening and let you know!
P.S.: what exactly does the "users" do? Does this have something to do with the group or does it allow (non-root) users to mount the partition??
Last edited by Thoddy; 07-01-2003 at 07:44 AM.
|
|
|
07-01-2003, 11:19 AM
|
#22
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Users allows non-root users to mount the partition, so if you are going with the above fstab, then that is exactly what you want. If you are going with only root access, then you'd remove that.
Cool
|
|
|
07-01-2003, 12:14 PM
|
#23
|
Member
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106
Rep:
|
Quote:
Originally posted by MasterC
Users allows non-root users to mount the partition, so if you are going with the above fstab, then that is exactly what you want.
|
Thanx Dude! - This rocks!
Now my private stuff cannot be seen by others anymore!
|
|
|
07-01-2003, 12:24 PM
|
#24
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
That's great
As I'm sure you know:
"Security by obscurity is no security at all" However, you are also secure from the permissions you've placed, so it's not obscurity alone, and therefore is slightly... OK
If you really wanted to get crazy with it you could look into mounting it elsewhere, such as inside your users home directory, this would also keep them from being able to access it, and of course, allow you to.
Cool
|
|
|
07-23-2003, 10:52 PM
|
#25
|
LQ Newbie
Registered: Jul 2003
Posts: 8
Rep:
|
Quote:
Originally posted by MasterC
I'd try mounting it first to help with defining possible errors:
mount -t vfat /dev/hdx /mnt/point -o user,rw,exec,uid=500
Where /dev/hdx is the actual device
and
/mnt/point
is a mount point of your choice, maybe:
/mnt/fat32
Make sure that directory exists first:
mkdir /mnt/fat32 (or whatever you choose)
If all mounts well, and acts as expected, then proceed to edit your fstab as shown above.
Cool
|
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
|
|
|
07-23-2003, 11:04 PM
|
#26
|
LQ Newbie
Registered: Jul 2003
Posts: 8
Rep:
|
Quote:
Originally posted by Becker004
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
|
Hey, i figured out my number! it was 4! But i get an error:!
my command: mount -t vfat /dev/hda4 /mnt/fat32 -o user,rw,exec,uid=500
mount: wrong fs type, bad option, bad superblock on /dev/hda4,
or too many mounted file systems
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
Any clues?
|
|
|
07-24-2003, 03:18 AM
|
#27
|
Member
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106
Rep:
|
Quote:
Originally posted by Becker004
Sorry,
But how do i tell which is the device. i have windows xp on my c drive and my f drive is the fat32.
Thank you for the help.
|
What kind of distribution do you use? In RedHat e.g. there is the Disk Druid for partitioning that can tell you...
I am not too sure, but can't a hard disk only have three primary partisions? Then the 4 would be reserved for the extended partition and the first logical partition in there would have the number 5!
As already mentioned - I am not too sure but you should give it a try. At least I remember from my own experience...
Thoddy
|
|
|
07-24-2003, 05:27 AM
|
#28
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
Depends...
You can have 4 primary partitions but this means you will be able to have 0 extended/logical partitions; because there has to be a primary partition to use to create the extended which will contain the logical partition.
If you look at:
fdisk -l (FDISK -L lowercase) or /sbin/fdisk -l (as root) if /sbin isn't in your PATH, then it will usually describe your disk geometry to you. If there are more than 4 entries, you have a logical (likely). It's then that you need to try a different partition, such as /dev/hda5 (which is likely if your extended is the last primary).
Cool
|
|
|
07-24-2003, 06:43 AM
|
#29
|
LQ Newbie
Registered: Jul 2003
Posts: 8
Rep:
|
fdisk -l
I used fdisk -l
Disk /dev/hda: 255 heads, 63 sectors, 2498 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 4 32098+ de Dell Utility
/dev/hda2 * 5 1796 14394240 7 HPFS/NTFS
/dev/hda3 1797 1809 104422+ 83 Linux
/dev/hda4 1810 2498 5534392+ f Win95 Ext'd (LBA)
/dev/hda5 1810 2433 5012248+ 83 Linux
/dev/hda6 2434 2498 522081 82 Linux swap
Disk /dev/hdb: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4866 39086113+ c Win95 FAT32 (LBA)
The device i want to mount is HDA4.
|
|
|
07-24-2003, 06:46 AM
|
#30
|
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613
Rep:
|
hda4 is an extended partition, it's shown there just to show you that it's there. The partitions hda4 is containing as logical partitions are hda5 and hda6 (hda6 is swap though). So if you want to mount hda4 in actuality you want to mount hda5 because that is the only usable partition in the hda4 extended partition.
Extended partitions aren't really partitions that you mount, they are like garages. You part your logical partititions inside the extended ones. You don't use/drive a extended partition/garage but you do use/drive a logical/car
If that helps at all
Cool
|
|
|
All times are GMT -5. The time now is 02:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|