Set up home structure for authorized_keys

Since password auth is disabled by default, we depend on keys in our home dir but they're not created for us and the perms are wrong by default. This commit sets it up correctly for the user to simply add their key to the empty authorized_keys file
This commit is contained in:
deed02392 2017-05-24 20:06:23 +01:00 committed by Fredrik Fornwall
parent 5838845ea6
commit e046e1b949
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ termux_step_post_make_install () {
termux_step_create_debscripts () {
echo "mkdir -p \$HOME/.ssh" > postinst
echo "touch \$HOME/.ssh/authorized_keys" >> postinst
echo "chmod 700 \$HOME/.ssh" >> postinst
echo "chmod 600 \$HOME/.ssh/authorized_keys" >> postinst
echo "" >> postinst
echo "for a in rsa dsa ecdsa ed25519; do" >> postinst
echo " KEYFILE=$TERMUX_PREFIX/etc/ssh/ssh_host_\${a}_key" >> postinst