Re: permissions and fstab

2001-03-28 Thread Justin B Rye
Carel Fellinger wrote:
 Or look through /etc/passwd.
 
$ grep carel /etc/passwd
carel:x:1001:1001:Carel Fellinger,,,:/home/carel:/bin/bash 

Or for variety (and a saving of milliseconds) do it this way:

 $ getent passwd jbr
 jbr:x:1013:1013:Justin B Rye,,,:/home/jbr:/bin/bash 

I love these obscure utilities - that one comes with libc6.
-- 
Justin B Rye - writing from but not for Datacash Ltd



Re: permissions and fstab

2001-03-28 Thread Marcelo Chiapparini
On Tue, Mar 27, 2001 at 02:19:46AM +0200, Carel Fellinger wrote:
 2) Mount by root, but for a specific user:
in /etc/fstab change the entry for that dos partition like this:
 
/dev/hda1 /winfun vfat defaults,uid=1001,gid=1001,noexec,nosuid,nodev 0 2
 
this will allow root but also the user with uid 1001 and gid 1001
to read and write to that partition. Only root can mount it.
[[ I've added the flags noexec,nosuid,nodev as they were implied by
   the user flag ]]

Carel,

it worked very well! thank you.
Marcelo

-- 
Marcelo Chiapparini
DFT-IF/UERJ
[EMAIL PROTECTED]



Re: permissions and fstab

2001-03-27 Thread Marcelo Chiapparini
Hi Carel

thank you very much for your answer. Now a stupid question: how can I find the 
uid and gid of my account?

Thanks in advance 

Marcelo

On Tue, Mar 27, 2001 at 02:19:46AM +0200, Carel Fellinger wrote:
 Hi Marcello,
 
snip
 2) Mount by root, but for a specific user:
in /etc/fstab change the entry for that dos partition like this:
 
/dev/hda1 /winfun vfat defaults,uid=1001,gid=1001,noexec,nosuid,nodev 0 2
 
this will allow root but also the user with uid 1001 and gid 1001
to read and write to that partition. Only root can mount it.
[[ I've added the flags noexec,nosuid,nodev as they were implied by
   the user flag ]]
 


-- 
Marcelo Chiapparini
DFT-IF/UERJ
[EMAIL PROTECTED]



Re: permissions and fstab

2001-03-27 Thread Ilya Martynov

MC thank you very much for your answer. Now a stupid question: how
MC can I find the uid and gid of my account?

use command 'id'

-- 
Ilya Martynov
AGAVA Software Company, http://www.agava.com



Re: Re: permissions and fstab

2001-03-27 Thread paolo pedaletti
Salve Marcelo Chiapparini,

 thank you very much for your answer. Now a stupid question: how can I find 
 the 
 uid and gid of my account?

$ id

-- 

Paolo Pedaletti, Como, ITALYa www.fastflow.it/~paolop
[EMAIL PROTECTED]   ICQ: 4755831



Re: permissions and fstab

2001-03-27 Thread Carel Fellinger
On Tue, Mar 27, 2001 at 10:34:58AM -0300, Marcelo Chiapparini wrote:
 Hi Carel
 
 thank you very much for your answer. Now a stupid question: how can I find 
 the 
 uid and gid of my account?

Either us the command id

   $ id
   uid=1001(carel) gid=1001(carel) 
groups=1001(carel),24(cdrom),29(audio),104(gezin),105(ouders),107(cvs),109(cvskids),110(cvsthuis)

Or look through /etc/passwd.

   $ grep carel /etc/passwd
   carel:x:1001:1001:Carel Fellinger,,,:/home/carel:/bin/bash 

[[ in /etc/passwd, the first number is your uid, the second your gid ]]

-- 
groetjes, carel



Re: permissions and fstab

2001-03-27 Thread Andreas Hetzmannseder
On Mon, Mar 26, 2001 at 06:04:21PM -0300, Marcelo Chiapparini wrote:
 Hi!
 
 I have a dos partition  which belongs to a win98 disk. I need to access 
 this dos partition from linux, in order to write some stuff on it. This 
 partition 
 is mounted automatically at startup trhough the appropriate entry in the 
 fstab 
 file. The problem are the permissions. This dos partition has root as owner, 
 so I don't have permission to write to it from my personal account. How can I 
 fix it at boot time? i.e I need this partition mounted with the correct 
 permissions which allows me to write to it from my personal account (which is 
 not root! :)).

Hi, Marcelo

I don't know how your fstab looks like but I think you need
the user option.

The entry for my win95-partition looks like this:

/dev/hda1  /mnt  vfat  defaults,user,noauto  0  0

This is mounted manually by any normal user and does always have the user's
permissions.

Hope this helps.
Kind regards,
Andreas.



Re: permissions and fstab

2001-03-27 Thread Andreas Hetzmannseder
On Mon, Mar 26, 2001 at 06:04:21PM -0300, Marcelo Chiapparini wrote:
 Hi!
 
 I have a dos partition  which belongs to a win98 disk. I need to access 
 this dos partition from linux, in order to write some stuff on it. This 
 partition 
 is mounted automatically at startup trhough the appropriate entry in the 
 fstab 
 file. The problem are the permissions. This dos partition has root as owner, 
 so I don't have permission to write to it from my personal account. How can I 
 fix it at boot time? i.e I need this partition mounted with the correct 
 permissions which allows me to write to it from my personal account (which is 
 not root! :)).

Hi Marcelo

Sorry for the corrupted message...

I don't know how your fstab looks like
but I think you need the user option.

My fstab entry for the windows-partition looks like this:

/dev/hda1  /mnt  vfat  defaults,user,noauto  0  0

/dev/hda1 is mounted manually by any normal user
and every user who mounts it gets the right permissions.

I hope this helps.
Kind regards,
Andreas.



Re: permissions and fstab

2001-03-27 Thread Andreas Hetzmannseder
On Mon, Mar 26, 2001 at 06:04:21PM -0300, Marcelo Chiapparini wrote:
 Hi!
 
 I have a dos partition  which belongs to a win98 disk. I need to access 
 this dos partition from linux, in order to write some stuff on it. This 
 partition 
 is mounted automatically at startup trhough the appropriate entry in the 
 fstab 
 file. The problem are the permissions. This dos partition has root as owner, 
 so I don't have permission to write to it from my personal account. How can I 
 fix it at boot time? i.e I need this partition mounted with the correct 
 permissions which allows me to write to it from my personal account (which is 
 not root! :)).

Hi Marcelo

Sorry... third try... seems to be a bad day for me...

I don't know how your fstab looks like
but I think you need the user option.

My fstab entry for the windows-partition looks like this:

/dev/hda1  /mnt  vfat  defaults,user,noauto  0  0

/dev/hda1 is mounted manually by any normal user
and every user who mounts it gets the right permissions.

I hope this helps.
Kind regards,
Andreas.



permissions and fstab

2001-03-26 Thread Marcelo Chiapparini
Hi!

I have a dos partition  which belongs to a win98 disk. I need to access 
this dos partition from linux, in order to write some stuff on it. This 
partition 
is mounted automatically at startup trhough the appropriate entry in the fstab 
file. The problem are the permissions. This dos partition has root as owner, 
so I don't have permission to write to it from my personal account. How can I 
fix it at boot time? i.e I need this partition mounted with the correct 
permissions which allows me to write to it from my personal account (which is 
not root! :)).

Thanks in advance!

Marcelo

-- 
Marcelo Chiapparini
DFT-IF/UERJ
[EMAIL PROTECTED]



Re: permissions and fstab

2001-03-26 Thread Carel Fellinger
Hi Marcello,

On Mon, Mar 26, 2001 at 06:04:21PM -0300, Marcelo Chiapparini wrote:

 I have a dos partition  which belongs to a win98 disk. I need to access 
 this dos partition from linux, in order to write some stuff on it. This 
 partition 
 is mounted automatically at startup trhough the appropriate entry in the 
 fstab 
 file. The problem are the permissions. This dos partition has root as owner, 
 so I don't have permission to write to it from my personal account. How can I 
 fix it at boot time? i.e I need this partition mounted with the correct 

[[ untested, mainly from reading the fine manuals (but admittedly prior
   to your question)  ]]

There are basicly three ways to handle this.

1) Remount per user:
   in /etc/fstab change the entry for that dos partition like this:

   /dev/hda1/winfun vfatdefaults,user   0 2

   this will allow any user on your system to unmount that dos partition
   and to remount it.  Remounting it will allow that user to write to it,
   but not others.  But ofcourse at any time others could remount it too,
   putting the first user again in a situation where he can't write to it.

2) Mount by root, but for a specific user:
   in /etc/fstab change the entry for that dos partition like this:

   /dev/hda1 /winfun vfat defaults,uid=1001,gid=1001,noexec,nosuid,nodev 0 2

   this will allow root but also the user with uid 1001 and gid 1001
   to read and write to that partition. Only root can mount it.
   [[ I've added the flags noexec,nosuid,nodev as they were implied by
  the user flag ]]

3) Mount by root, but with very permissive file permissions:
   in /etc/fstab change the entry for that dos partition like this:

   /dev/hda1/winfun vfatdefaults,umask=000,noexec,nosuid,nodev  0 2

   this allows any body to read/write to this partition, but only root
   can mount it.

4) Combine 2 and 3:
   in /etc/fstab change the entry for that dos partition like this:

   /dev/hda1 /winfun vfat defaults,gid=1500,umask=002,noexec,nosuid,nodev 0 2

   This will allow root and any user with gid 1500 to write to it. Every
   body can read from it, but only root can mount it.


In my home situation I prefere 1: the windows partitions are readonly
by default, yet accessible at will.  In les friendly environments I
would prefer 4:)  One could even try a combination of 1, 2 and 3
-adding the benifit of read-only per default-, but I think it won't
work, as malicious users could repeatedly remount it, preventing any
real work to be done.

-- 
groetjes, carel