sshpass: Login To SSH Server provide SSH Password Using A Shell Script

Created on Feb 19, 2020 by 

  1. copysudo apt-get install sshpass
  2. copysshpass -p 'passwd' ssh username@server_ip


description

#!/bin/bash

PASSWD="passwd"

sshpass -p $PASSWD ssh username@server.example.com

 

sshpass


name

sshpass - noninteractive ssh password provider

synopsis

sshpass [-ffilename|-dnum|-ppassword|-e] [options] command arguments

description

This manual page documents the sshpass command.

apt-get


name

apt-get - APT package handling utility -- command-line interface

synopsis

apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
[-t=target_release] [-a=architecture] {update | upgrade |
dselect-upgrade | dist-upgrade |
install pkg [{=pkg_version_number | /target_release}]... |
remove pkg... | purge pkg... |
source pkg [{=pkg_version_number | /target_release}]... |
build-dep pkg [{=pkg_version_number | /target_release}]... |
download pkg [{=pkg_version_number | /target_release}]... |
check | clean | autoclean | autoremove | {-v | --version} |
{-h | --help}}

description

apt-get is the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library. Several "front-end" interfaces exist, such as aptitude(8), synaptic(8) and wajig(1).