~alpine/devel

alpine-conf: setup-sshd offers to setup openssh key authentication v1 PROPOSED

Alan Lacerda: 1
 alpine-conf: setup-sshd offers to setup openssh key authentication

 1 files changed, 19 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/devel/patches/566/mbox | git am -3
Learn more about email & git

[alpine-devel] [PATCH] alpine-conf: setup-sshd offers to setup openssh key authentication Export this patch

---
 setup-sshd.in | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/setup-sshd.in b/setup-sshd.in
index 1890b7c..1e6da29 100644
--- a/setup-sshd.in
+++ b/setup-sshd.in
@@ -46,6 +46,25 @@ case "$sshdchoice" in
	dropbear) svc=dropbear;;
esac

echo -n "Do you want to set up SSH key authentication [y|N]? "
default_read sshauthkey "n"

if [ "$sshdchoice" = "openssh" ]; then
	if [ "$sshauthkey" = "y" ] || [ "$sshauthkey" = "Y" ]; then
		sed -i 's/\#PasswordAuthentication\ yes/PasswordAuthentication\ no/g' /etc/ssh/sshd_config
		mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys
		echo -n "Do you want to add keys to the authorized_keys file [Y|n]? "
		default_read sshaddkey "y"
		if [ "$sshaddkey" = "y" ] || [ "$sshaddkey" = "Y" ]; then
			vi ~/.ssh/authorized_keys
		else
			echo ""
			echo "WARNING: Do not forget to add your public key to ~/.ssh/authorized_keys"
			echo ""
		fi
	fi
fi

if [ -n "$svc" ]; then
	rc-update add $svc default
	rc-service $svc start
-- 
2.1.3



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---