From 6aa280f430ae0279755e411b9fb49adaf868774a Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Mon, 26 Dec 2016 17:36:27 +0100 Subject: [PATCH] =?UTF-8?q?ssh=20authentifizierung=20=C3=BCber=20public=20?= =?UTF-8?q?keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shellinabox_sshwrapper.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/shellinabox_sshwrapper.sh b/shellinabox_sshwrapper.sh index 02e0d7e..e0d77d2 100644 --- a/shellinabox_sshwrapper.sh +++ b/shellinabox_sshwrapper.sh @@ -2,8 +2,25 @@ #  read -p "SSH remote host (hostname or ip address): " host; # +read -p "If a puplic_key authentification?: N or y: " puplic; +# read -p "SSH remote port (22): " port; # read -p "SSH remote username: " username; # -exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $port $username@$host; +if [ "$puplic" == "y" ]; + then + read -p "Why it the public_key?: " key; + echo $key > ~/.ssh/id_rsa.pub; + + rm ~/.ssh/id_rsa; + echo "Give youre id her ein and when youre ready give finish ein."; + while [ "$id" != "finish" ]; + do + read -p "Why it the id_rsa key?: " id; + echo $id >> ~/.ssh/id_rsa; + done + exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $port $username@$host; + else + exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p $port $username@$host; +fi