[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: How to pass a password to `mount`?
From:       Steven Pasternak <stevenp500 () bellsouth ! net>
Date:       2005-02-20 4:14:29
Message-ID: 200502192314.30047.stevenp500 () bellsouth ! net
[Download RAW message or body]

On Saturday 19 February 2005 11:06 pm, Mark A. Taff wrote:
> On Saturday 19 February 2005 19:52, Brad Hards wrote:
> > On Sun, 20 Feb 2005 14:26 pm, Mark A. Taff wrote:
> > > I have created an encrypted file (/dev/loop0), but kde will not pass or
> > > prompt for a password before trying to mount the device.  So I am
> > > writing a quick perl script to do this with KDialog's help.
> > >
> > > The sticking point is I can't even figure out how to pass a password to
> > > mount on the command line.  man mount says:
> >
> > I'm not sure I understand what you want to do. Do you want to pass the
> > password from standard in? If so, the filedescriptor for standard in is
> > 0.
> >
> > Brad
>
> In a shell, `mount /dev/loop0` will prompt me for a password, which I have
> to enter.  I would like to be able to use kdiskfree to specify the mount
> command as the script I'm writing.  Kdialog would then prompt for a
> password.
>
> The key diff here is that according to man mount, you can specify the
> password within the mount command itself.
>
> The ultimate goal is I don't want to have to go to a cli to mount this,
> unless I choose to.  I'd like a nice gui for it.
>
> Here is how I have perl setup to call mount right now:
>
> @args = ("mount", "$ARGV[0]",
> "$ARGV[0]");
> system(@args) == 0
>   or die "system @args failed: $?"
>
> Where argv[0] is /dev/loop0 and argv[1] would be the password.
>
>
> Thanks.
I just use sudo for this. If you want to be able to mount it as root w/o the 
root password, ad this to the /etc/sudoers file using visudo. You MUST use 
visudo (a special way that is the only way to make sudo work, it is like 
Vim):
  <username>       ALL=(ALL)       NOPASSWD: ALL

Just replace <username> with your user name.
This works too:
  %<groupname>        ALL=(ALL)       NOPASSWD: ALL

and you replace <groupname> with the name of the group (just remember the % in 
front for groups). Hope this helps!
-Steven
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic