X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 0F3CDDC1E1D for ; Thu, 27 Nov 2014 15:21:46 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id i13so3361288qae.41 for ; Thu, 27 Nov 2014 07:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=AK4hD459KxKIFrMdXMkrXRg/ylbByLJWesON1ahmzjM=; b=IAY0RionU+SvB7cSIQZkgpijvSkiFv2ag6Vtw33RsfJyqg2Xj0RPPzN7yBFujDQZ5i wD+D9pxN9eWrmch05FLbxLBDsDczKsVnyJebsAs7juFYtTBzWLmEL6/+/SIQmJxqr5sr sSfkcF2T9VUbCGj8eeoyW23S08GyNuLPV1lorayVce8RhDuiorZoC5A+yEDxglaUwJDs cFUq4hpAikw5VY/+QOHPSuBe7YYfdF9PtXGP76V1E+lVA04BElnjXEkjKfTqhO6RZCLj AoTP+nXomg1+6X4aRTvUZdkAge62hDbqMI/JMMPAyFFqOrz3X4ovPvpiP3MaU1/+JGKx IB8Q== X-Received: by 10.224.4.8 with SMTP id 8mr50578407qap.77.1417101706272; Thu, 27 Nov 2014 07:21:46 -0800 (PST) Received: from labgit.bethel.jw.org ([186.233.140.3]) by mx.google.com with ESMTPSA id o9sm6757387qay.48.2014.11.27.07.21.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Nov 2014 07:21:45 -0800 (PST) From: Alan Lacerda X-Google-Original-From: Alan Lacerda To: alpine-devel@lists.alpinelinux.org Cc: Alan Lacerda Subject: [alpine-devel] [PATCH] alpine-conf: setup-sshd offers to setup openssh key authentication Date: Thu, 27 Nov 2014 15:21:36 +0000 Message-Id: <1417101696-6236-1-git-send-email-alacerda@alpinelinux.org> X-Mailer: git-send-email 2.1.3 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- 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 ---