#!/bin/bash
echo "Connecting to the vm..."
ssh -t root@${host} ${command}
This is a shell script to send commands to a remote machine via ssh, It is giving password prompt. But there is no need to enter password and only enter key press is required. How to pass enter key press to this ssh command when prompted
Tried to send 'Enter' key using the following methods, But it is not working
echo -ne '\n' | ssh -t -t root@${host} ${command}
cat <(echo "") | ssh -t -t root@${host} ${command}
yes '' | ssh -t -t root@${host} ${command}