Skip to content

Instantly share code, notes, and snippets.

@ProjectSky
Created April 15, 2017 13:42
Show Gist options
  • Save ProjectSky/77cf7e0e0dcc6bd4441bd0faa34a8164 to your computer and use it in GitHub Desktop.
Save ProjectSky/77cf7e0e0dcc6bd4441bd0faa34a8164 to your computer and use it in GitHub Desktop.
Simple login script
#!/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