Update add key section
This commit is contained in:
parent
a99b8e534f
commit
63eb5d9df4
1 changed files with 2 additions and 2 deletions
|
|
@ -39,7 +39,7 @@ done
|
|||
|
||||
#Add users public key
|
||||
while true; do
|
||||
read -p "The path to the user's pubkey?:" key
|
||||
read -p "The user's pubkey?:" key
|
||||
if ! [ "$key" = '' ];then break;fi
|
||||
echo "Must set a pubkey."
|
||||
done
|
||||
|
|
@ -106,7 +106,7 @@ fi
|
|||
if [ "$dokey" = 'y' ]; then
|
||||
echo "Adding pubkey..."
|
||||
install -dm700 "/home/$name/.ssh"
|
||||
cat "$key" >> "/home/$name/.ssh/authorized_keys"
|
||||
echo "$key" >> "/home/$name/.ssh/authorized_keys"
|
||||
chmod 600 "/home/$name/.ssh/authorized_keys"
|
||||
echo "Making user owner of authorized_keys..."
|
||||
chown -R "$name:$name" "/home/$name"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue