Client OS: MacOS 12.1, Server OS: Linux Debian 9 (any server)
case 1:
#!/bin/bash
sshpass -p mypass ssh user@host.ru -o StrictHostKeyChecking=no
case 2:
#!/bin/bash
sshpass -p mypass ssh user@host.ru -o StrictHostKeyChecking=no "cd /var/www ; git status ; /bin/bash"
Output of "git status" works fine, but
no "user@host:~$" message in output (input is active).
I tried: /bin/bash bash -l (in server "echo $SHELL" shows /bin/bash)
How to fix it?
Use ssh -t
and && inside commands list
#!/bin/bash
sshpass -p mypass ssh -t user@host.ru -o StrictHostKeyChecking=no "cd /var/www && git status && /bin/bash"