- how to get permission to mount devices and save files as user
- Posted by Christian Radermacher on March 3rd, 2004
when I login as root all is OK, but when I login as a user (which only
belongs to the users group) I can't mount devices, I can't save files
and so on because I have no permissions.
I'm running Slackware 9.1 whit KDE 3.1.4, and I can manage users through
KUser. Can anyone say me which group my user has to belong to for having
the wanted permissions?
thank you very much
- Posted by Andreas Janssen on March 3rd, 2004
Hello
Christian Radermacher (<rader@inwind.it>) wrote:
To mount devices, add a line to the fstab using the user or users
option. Read the mound and fstab man pages for details.
If you can't save files, maybe it is because you are not supposed to
write files to that folders as a user. If you can't write to mounted
devices like windows partitions, check the umask, uid and gid options
in the mount man page (for example the chapter about FAT filesystems).
If you need more information, please give us more details.
best regards
Andreas Janssen
--
Andreas Janssen <andreas.janssen@bigfoot.com>
PGP-Key-ID: 0xDC801674
Registered Linux User #267976
http://www.andreas-janssen.de/debian-tipps.html
- Posted by Christian Radermacher on March 5th, 2004
Andreas Janssen wrote:
Thank you for your help! I understood a user can modify files only if he
is the owner of that file; except root, who can modify every file.
But I've not resolved the mount problem.
this is my fstab before modifications:
/dev/hdc1 swap swap defaults 0 0
/dev/hdc2 / ext2 defaults 1 1
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
and this is after modifications:
/dev/hdc1 swap swap defaults 0 0
/dev/hdc2 / ext2 defaults 1 1
/dev/hda1 /mnt/hd2 vfat users 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro,users 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,users 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
the devices which give me problems are /dev/hda1 (FAT32), and /dev/cdrom.
Sometimes when cd-drive is trying to be mounted I become a message which
says: "mount: wrong fs type, bad option, bad superblock on /dev/cdrom,
or too many mounted file systems".
For the 2nd hard-drive it says: "Access denied to /mnt/hd2".
I hope I've expaind my problem clearly enough...
- Posted by Johan Lindquist on March 5th, 2004
So anyway, it was like, 15:22 CET Mar 05 2004, you know? Oh, and, yeah,
Christian Radermacher was all like, "Dude,
s/users/user/
--
Time flies like an arrow, fruit flies like a banana. Perth ---> *
15:48:56 up 12 days, 22:25, 7 users, load average: 1.61, 1.25, 1.08
$ cat /dev/bollocks "echo y | format c:" Registered Linux user #261729
streamline seamless convergence
- Posted by P.T. Breuer on March 5th, 2004
Christian Radermacher <rader@inwind.it> wrote:
So? What's the problem with that? Clean your wires, or cdrom, or
something.
That's the FIRST hard drive, hda, and the FIRST partition on it, hda1.
Why you call it "hd2" is a bit difficult to comprehend. Anyway, there's
no way we can tell what command you issued from here, but I imagine
that /dev/hda2 does not have rw perms for you. Does it matter? I doubt
it, if /bin/mount is suid root and you issued "mount /mnt/hd2". But
then you don't tell us if it is or not, nor what command you issued, so
we can't really say much useful.
Personally I would guess that mount is suid root, but that
you issued "mount /dev/hda1 /mnt/hd2" instead of "mount /mnt/hd2".
Can't tell until you say what you are doing and what the state is.
You haven't. It needs more expaintion.
Peter
- Posted by Andreas Janssen on March 5th, 2004
Hello
Christian Radermacher (<rader@inwind.it>) wrote:
Maybe the CD is scratched or dirty.
This means you can't read or write to /mnt/hd2 after mounting /dev/hda1
there? Seems you need to use the umask, uid or gid options to set the
permissions for your FAT file system. Read the mount man page. Or go to
groups.google.com and search the archive of this group. This has been
explained very often here.
best regards
Andreas Janssen
--
Andreas Janssen <andreas.janssen@bigfoot.com>
PGP-Key-ID: 0xDC801674
Registered Linux User #267976
http://www.andreas-janssen.de/debian-tipps.html
- Posted by Christian Radermacher on March 5th, 2004
P.T. Breuer wrote:
Well, i think it is indifferent how you call your mounted devices.
the command i try to call is "mount /dev/hda1 /mnt/hd2" and I become the
message "mount: only root can do that"
- Posted by Dances With Crows on March 5th, 2004
On Fri, 05 Mar 2004 19:52:47 GMT, Christian Radermacher staggered into
the Black Sun and said:
Christian: Though Peter usually gives good advice, he tends to think
everyone is as experienced as he is, and he skips over details
sometimes. I'll try to clarify things:
If you haven't done so already, get one of those CD-ROM cleaning kits.
They're about $5 and consist of a special CD and maybe some
lens-cleaning fluid. Maybe it'll help. Also look at the CD itself,
things like a small scratch or a hair on the CD will cause errors like
this.
Only root can pass arbitrary parameters or more than one argument to mount.
user@machine:~$ mount -t vfat /mnt/hd2
(fails)
user@machine:~$ mount /mnt/hd2
(works)
root@machine:~# mount -t vfat /mnt/hd2
(works)
....so if your fstab entry is like so:
/dev/hda1 /mnt/hd2 vfat noauto,user,umask=000 0 0
....then a user can execute "mount /dev/hda1" or "mount /mnt/hd2" and
have it work and have full access to the files on /dev/hda1. HTH,
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
- Posted by P.T. Breuer on March 5th, 2004
Christian Radermacher <rader@inwind.it> wrote:
That's what I said. Why did you make me have to guess that? It would
have been much easier if you had SAID so.
As I said, that's wrong. Do what I said, instead.
Peter
- Posted by Christian Radermacher on March 6th, 2004
Oh thank you very much Dances With Crows,
this was the only think I wanted to know about the disk mounting, but
now I can't mount the cddrive: he says "mount: only root can mount
/dev/cdrom on /mnt/cdrom". I suppose that the modifications in the
/etc/fstab had influenced the options of the cddrive device.
Christian