below is my use case , I have to take a input from a user for a specific command which need to run on a remote machine.But my problem is I am not able to access that machine directly so what I am doing
Ssh to othere server and from their I am doing ssh to that server. But at that server we are not able to take any inout from user.
Below is a sample script:-
ssh user@machine1 /bin/bash <<\EOF1
ssh user@machine2 /bin/bash <<\EOF2
pwd
echo " Enter input :"
read -r input
curl -XPOST -k -H "Content-type: application/json" -d '{ "LOGIN_URL": "https://xyz/login","LOGIN_USER": "user11@gmail.com", "LOGIN_PASSWORD": "xyz", "CID": "'"$input"'" }' 'https://abc/gettoken' > sample
scp sample.txt root@user1:/root
It does not ask for user input and dirctly jump to scp command. Also is this a correct way to pass a variable in a curl command
Any help will be appreciated!