Double check if you are not able to use keys.
Otherwise use expect:
#!/usr/bin/expect -f
spawn ssh [email protected]
expect "assword:"
send "mypassword\r"
interact
More Related Contents:
- Pass commands as input to another command (su, ssh, sh, etc)
- While loop stops reading after the first line in Bash
- What is the cleanest way to ssh and run multiple commands in Bash?
- ssh breaks out of while-loop in bash [duplicate]
- Getting ssh to execute a command in the background on target machine
- How to run the sftp command with a password from Bash script?
- Openssh Private Key to RSA Private Key
- How to create a bash script to check the SSH connection?
- Running a Bash script over ssh
- Loop only iterates once with `ssh` in the body [duplicate]
- access host’s ssh tunnel from docker container
- How to escape the single quote character in an ssh / remote bash command?
- Passing a variable to a remote host in a bash script with ssh and EOF [duplicate]
- while loop to read file ends prematurely
- Using a variable’s value as password for scp, ssh etc. instead of prompting for user input every time
- How do I kill a backgrounded/detached ssh session?
- Correct Bash and shell script variable capitalization
- Using getopts to process long and short command line options
- How do I compare two string variables in an ‘if’ statement in Bash? [duplicate]
- How to put a line comment for a multi-line command [duplicate]
- How to calculate time elapsed in bash script?
- How do I get the directory where a Bash script is located from within the script itself?
- Bash: Syntax error: redirection unexpected
- Difference between return and exit in Bash functions
- Bash inserting quotes into string before execution
- How to modify a global variable within a function in bash?
- Rename multiple files in shell [duplicate]
- $BASH_VERSION reports old version of bash on macOS, is this a problem that should be fixed?
- Extract version number from a string
- Loop over array, preventing wildcard expansion (*)