# fstab permissions

## macleod

ok this is the deal i want to be able to write to any folder on hda3 (root) as user i dont want to have to logon as root everytime i want to change sumtin how is the best way to do this

/dev/hda1               /boot           ext2            noauto,noatime  1 2

/dev/hda3               /               ext3            noatime         0 1

/dev/hda2               none            swap            sw              0 0

/dev/cdrom              /mnt/cdrom      auto            noauto,rw,user  0 0

#/dev/fd0               /mnt/floppy     auto            noauto          0 0

this is my current fstab file ill be adding other drives soon as i get everything installed but i want to be able to use all the dam drives without having to login root all the time to write to them.

----------

## schachti

If you really want it, you are better off with Windows than linux...

If you really want to kill your system: man chmod.

----------

## macleod

ive had it set before but its been to long to remember how to set the fstab file i know you can read and write to hda3 and any other drive you put in your pc as long as its not ntfs (well you can write to ntfs but not correctly) all i want is to be able to mount my drives in /mnt and be able to write to them actually all i need access to is the /mnt folder so i can add folders there to mount my drives to like /mnt/hd20gig and so on i just want to be able to write the all my other internal drives actually not be able to write to every folder just mnt folder

----------

## NathanZachary

Well, if you really want to do that (BIG security risk), you would just use chmod:

http://www.perlservices.net/perlfaqs/quickchmod_1.html#09102395

Also, this really isn't about installing Gentoo, so I'm going to request that it be moved to the appropriate sub-forum.

----------

## desultory

Moved from Installing Gentoo to Networking & Security, as file permissions are a fundamental element of the standard Linux security model.

----------

## rokstar83

Before you start using chmod, what are specifically trying to write?  And when you say login as root, are you using the su command or are you actually logging out of (presumably X) and then logging in again as root?  Have you tried using the sudo command for small things, like say editing portage files, or /etc/ config files?  More generally why are you bent on giving everyone (or even just your local user account) access to your system?  What specifically are you trying to gain by it?  As you can probably already guess from some of the responses this is somewhat risky if not suicidally so.

----------

## mbreith

A bit less risky is to pick your favorite editor and use sudo for that. For example, nedit.

```
sudo nedit /etc/make.conf
```

and you will be able to edit and save the file with root permissions. You can set sudo up so that it doesn't ask for a password.

----------

## runningwithscissors

 *macleod wrote:*   

> ....all i want is to be able to mount my drives in /mnt and be able to write to them actually all i need access to is the /mnt folder so i can add folders there to mount my drives to like /mnt/hd20gig and so on i just want to be able to write the all my other internal drives actually not be able to write to every folder just mnt folder

 

Then you don't need write access to the entire root partition.

You simply make a group that will have write permissions to any mounted partition in /mnt and make yourself a member of that group. Problem solved.

How do you do it? You create a group called mountwrite or something.

```
# groupadd -gid 666 mountwrite
```

Then you add yourself to the group using

```
# gpasswd -a <user> mountwrite
```

Then you edit fstab to mount known partitions with the proper permissions for users of group mountwrite

```
/dev/<partition>               /mnt/<mountpoint>      <partition type>            noauto,rw,gid=666,dmask=0007,fmask=007  0 0
```

or something like that.

Then everytime you mount that partition, you will have write permissions to it, as will all other users of the group mountwrite.

To mount a partition maually with write permissions for you that is not listed in fstab use:

```
# mount /dev/<partition> /mnt/<mountpoint> -o rw,gid=666,dmask=0007,fmask=007
```

Hope this helps.

----------

