I'm trying to execute a simple ssh remote command from my local machine to an AWS instance, by running:
ssh -i /my/key.pem ec2-user@<myhost> 'ls -l'
When I do this, the command returns with exit code 255 and it leaves a process hanging on the ec2 instance
sshd: ec2-user [priv]
If I run it with a tty
ssh -t -i /my/key.pem ec2-user@<myhost> 'ls -l'
It works. Even though
'ls -l doesn't require user input, why does it still require a tty, and why does it leave that process hanging?