Created
April 15, 2017 13:42
-
-
Save ProjectSky/77cf7e0e0dcc6bd4441bd0faa34a8164 to your computer and use it in GitHub Desktop.
Simple login script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Simple login script (No password) | |
show_all() { | |
cat <<USERLIST | |
Select login user: | |
1: user1 | |
2: user2 | |
3: user3 | |
USERLIST | |
} | |
if [ ! -e $PREFIX/bin/sshpass ]; then | |
echo "y" | sudo apt install sshpass | |
fi | |
USER= | |
show_all; read option | |
case $option in | |
1) | |
echo 'Use user Login' | |
sshpass -p 'yourpassword' ssh user@address -p port | |
;; | |
2) | |
echo 'Use user Login' | |
sshpass -p 'yourpassword' ssh user@address -p port | |
;; | |
3) | |
echo 'Use user Login' | |
sshpass -p 'yourpassword' ssh user@address -p port | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment