su - user variable problem
From: Tracy Saenz (t.saenz_at_rfc.edu)
Date: 06/21/05
- Next message: Netocrat: "Re: su - user variable problem"
- Previous message: Michael Tosch: "Re: grep this or that"
- Next in thread: Netocrat: "Re: su - user variable problem"
- Reply: Netocrat: "Re: su - user variable problem"
- Reply: Alan Connor: "Re: su - user variable problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Jun 2005 08:09:23 -0700
I am writing a bash script to create users, and then generate an rsa
key protected with a password that is supplied as an argument to the
script. The users run an app that requires an ssh tunnel, and I want to
eliminate passwords. I pull the serial off their hard drive and use it
to encrypt the ssh key. It reduces the chance of users sharing keys,
which is why I'm doing this.
The script does seem to work except for one thing. The variable
contained in $2 is not being passed to the -P switch like $1 is. This
command does work if run directly from the command line if I use a
static values instead of variables. I don't understand why $1 is
interpreted but not $2.
su - $1 -c 'ssh-keygen -t rsa -f /home/$1/.ssh/$1 -P $2'
Thanks for your help!
- Next message: Netocrat: "Re: su - user variable problem"
- Previous message: Michael Tosch: "Re: grep this or that"
- Next in thread: Netocrat: "Re: su - user variable problem"
- Reply: Netocrat: "Re: su - user variable problem"
- Reply: Alan Connor: "Re: su - user variable problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|