Originally Posted by
K.Kode
#!/bin/sh
passwd="$6$BLAHBLAHBLAH"
user="username"
useradd -m -p $passwd $user
mkdir /home/$user/.ssh
echo ssh-rsa BLAHBLAHBLAH= > /home/$user/.ssh/authorized_keys2
Or something of that ilk.
tried that, but it doesn't work
ok basically what i have right now is: (found this via google)
Code:
#!/bin/sh
user="testpeon"
shell=/bin/bash
OPENSSL=/usr/bin/openssl
PASS=`$OPENSSL rand -base64 12`
echo $PASS
useradd -s $shell -m -p $PASS $user
what i want to happen is for it to create a user (for example "bob") and set a pre-determined password for that user. then copy the ssh key into the correct place, for which i could use
Code:
echo ssh-rsa BLAHBLAHBLAH= > /home/$user/.ssh/authorized_keys2
from k.kodes example above. this would be the first part of my post-install script; the rest would be anything i would want to install etc ..