Skip to content

Commit

Permalink
Merge pull request #94 from linuxserver/config-perms
Browse files Browse the repository at this point in the history
  • Loading branch information
thespad authored Nov 22, 2024
2 parents 317255b + e5ca2b0 commit 0473778
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/init-openssh-server-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,5 @@ chmod 700 \
/config/.ssh
chmod 600 \
/config/.ssh/authorized_keys
chown root:root \
/config/ssh_host_keys
12 changes: 7 additions & 5 deletions root/keygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# selection menu
echo "Please select your key type to generate"
printf "1.) ecdsa\n2.) rsa\n3.) ed25519\n4.) dsa\n[default ecdsa]:"
printf "1.) ed25519\n2.) rsa\n3.) ecdsa\n4.) dsa\n[default ed25519]:"
read opt
case $opt in
"ecdsa"|1) TYPE="ecdsa" BITS="-b 521";;
"ed25519"|1) TYPE="ed25519";;
"rsa"|2) TYPE="rsa";;
"ed25519"|3) TYPE="ed25519";;
"ecdsa"|3) TYPE="ecdsa" BITS="-b 521";;
"dsa"|4) TYPE="dsa";;
*) echo "blank or unknown option choosing ecdsa" && TYPE="ecdsa" BITS="-b 521";;
*) echo "blank or unknown option choosing ed25519" && TYPE="ed25519";;
esac
# rsa bit selection
if [[ "$TYPE" == "rsa" ]]; then
Expand All @@ -25,5 +25,7 @@ if [[ "$TYPE" == "rsa" ]]; then
fi

# key generation
echo "YOUR KEY/PUBFILE IS BELOW PLEASE SAVE THIS DATA AS WE WILL NOT"
echo ""
echo "YOUR KEYS ARE BELOW. PLEASE TAKE A COPY OF THEM AS THEY WILL NOT PERSIST ONCE THIS TERMINAL IS CLOSED."
echo ""
echo /tmp/stderr{,.pub} | xargs -n 1 ln -sf /dev/stderr && yes | ssh-keygen -t ${TYPE} ${BITS} -N '' -qf /tmp/stderr > /dev/null

0 comments on commit 0473778

Please sign in to comment.