I need my app to connect to a remote server via ssh, and run terminal commands. As far as I know, this is a non-interactive connection. Which differs from the one you open a terminal by yourself. I'm getting some errors right now when my app runs terminal commands. I want it to act exactly like I myself running these commands. So how can I achieve this? I'm a programmer not a Linux expert though.
Asked
Active
Viewed 778 times
0
ssh -t
orssh -tt
may help; or (local)expect
, if you need to "type" input not-too-soon or so. Can you provide mcve? You may omit "verifiable", but at least show us the commands you used and the errors you got. – Kamil Maciorowski Dec 08 '21 at 11:25[ -z "$PS1" ] && return
form.bashrc
file. And it's working. I mean I get no more errors. But I don't know if it's a reliable solution. – james hofer Dec 08 '21 at 11:36.bashrc
to be processed. It's possible some other line(s) shouldn't be processed, so the fact you entirely disabled the "twist 3" may bite you later. It may be good to identify the lines you need, re-enable the "twist 3" and place the needed lines before the "twist 3 line". Without seeing your.bashrc
, the commands and the errors, it's hard to tell what the lines may be. – Kamil Maciorowski Dec 08 '21 at 21:20