3 # Script to interactively add root password and authorized_keys file
5 # Copyright 2008 Red Hat, Inc.
6 # Written by Perry Myers <pmyers@redhat.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; version 2 of the License.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Library General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 DEFAULT_AUTH
=~
/.ssh
/authorized_keys
23 printf "Do you want to set a root password? [y/N]: "
25 if [ "$yesno" = "y" -o "$yesno" = "Y" ]; then
29 printf "Do you want to set an authorized_keys file? [y/N]: "
31 if [ "$yesno" = "y" -o "$yesno" = "Y" ]; then
32 echo "Enter the location of the authorized_keys file [default: $DEFAULT_AUTH]: "
34 if [ -z "$authkeys" ]; then
35 authkeys
=$DEFAULT_AUTH
38 authkeys
=$
(eval echo $authkeys)
39 if [ -f $authkeys ]; then
41 AUTH
=$SSH/authorized_keys
48 echo "$authkeys not found, skipping"