Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/system/xbin/bash
- echo "---CONFIGURE-SSH-DAEMON---"
- echo ""
- read -s -p "Enter new password:" NEWPASS
- echo ""
- while [[ -z "$NEWPASS" ]]; do
- echo ""
- echo "Password CAN NOT be blank"
- echo ""
- read -s -p "Enter new password:" NEWPASS;
- echo ""
- done
- sed -i -e"s/^PASS=.*/PASS=$NEWPASS/" /etc/sshd.conf
- if test $? -eq 0; then
- echo 'password written'
- else
- echo 'write attempt failed!'
- fi
- echo ""
- read -p "Enter new port: " NEWPORT
- if test "$NEWPORT" = ""; then
- echo "DEFAULT PORT #2222"; sed -i -e"s/^PORT=.*/PORT=2222/" /etc/sshd.conf
- else
- sed -i -e"s/^PORT=.*/PORT=$NEWPORT/" /etc/sshd.conf
- fi
- if test $? -eq 0; then
- echo "port set"
- else
- echo "write attempt failed!"
- fi
- echo ""
- if [[ $(find /data/data/br.com.bott.droidsshd/files/etc/ -name "dropbear_rsa_host_key") ]]; then
- echo "Should we remove old key(s)?";
- echo "";
- rm -i /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_rsa_host_key;
- echo "";
- rm -i /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_dss_host_key
- fi
- echo ""
- echo "---GENERATING-RSA-KEY---"; dropbearkey -t rsa -f /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_rsa_host_key; chmod 400 /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_rsa_host_key
- echo ""
- echo "---GENERATING-DSS-KEY---"; dropbearkey -t dss -f /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_dss_host_key; chmod 400 /etc/dropbear/data/br.com.bott.droidsshd/files/etc/dropbear_dss_host_key
- echo ""; echo "Restarting dropbear with new settings..."
- killall dropbear
- echo ""
- dropbear
- echo ""
- echo ""; echo "Press RETURN to continue"; read return; clear
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement