xiaodongwang 4db535fd31 reformat preseed
Change-Id: I7c86310f1788ef144442b269b91581e48f7c8fda
2014-11-11 17:49:39 -08:00

26 lines
646 B
Plaintext

sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
mkdir -p /root/.ssh
chmod 700 -R /root/.ssh
#if $getVar("push_ssh_keys", "") != ""
#set $ssh_keys = $push_ssh_keys.split(',')
#set $firstline = True
#for $ssh_key in $ssh_keys
#if not $ssh_key
#continue
#end if
#set $f = open($ssh_key)
#if firstline
cat << EOF > /root/.ssh/authorized_keys
#echo $f.read()
EOF
#else
cat << EOF >> /root/.ssh/authorized_keys
#echo $f.read()
EOF
#end if
#set $firstline = False
#silent $f.close()
#end for
chmod 600 /root/.ssh/authorized_keys
#end if