Script for ssh connections by password using bitwarden. the official recommendation is to use ssh key, but this script considers cases where this is not possible, why it is prohibited or it is not considered necessary.
- openssh-client (ssh)
- sshpass
This script does not manage passwords, but uses an external password manager, which supports:
git clone https://github.com/esturafd/fruit.git .fruit
chmod 765 .fruit/fruit.sh
cd /usr/bin; sudo ln -s ~/.fruit/fruit.sh fruit
# fruit [fruit-options] TARGET [ssh-options]
#
# Options:
# -p specific executor like ssh, sftp, etc
# -f sftp executor
# -h this help
# common use without options
fruit test.com
# use with ssh options
fruit something.com -L 80:otherhost:8080
# use with fruit options
fruit -f ohterhost.com
It's recommended to add the host configuration to the ssh configfile, configurations such hostname, user or others,
and with hostid add a new item in bitwarden with name of ssh:<hostid>
.
Host example
HostName 192.168.1.34
User someuser
# fruit example
This script uses these configuration variables:
It refers to the ssh configuration file that will be used by default, if it is empty, the one with ssh by default will be used
This variable indicates the password manager that will be used to obtain the passwords, its value can be bitwarden
or pass
.
This variable refers to the user of the password manager account (bitwarden) or of the folder hierarchy where the passwords to be obtained are found (pass).