SSH Error - standard in must be a TTY
Asked Answered
C

1

5

I'm trying to run the following command:

ssh -i FILENAME.pem [email protected] su --session-command="./update.sh"

I keep getting the error message:

standard in must be a tty

How can I SSH on to the server then run the file called ./update.sh?

Cyrenaic answered 2/1, 2013 at 15:22 Comment(0)
J
8

SSH into your instance and run sudo visudo. Find this line: Defaults requiretty and add this line below it: Defaults:ec2-user !requiretty Save and exit. (If you're not familiar with vi, press i to go into insert mode to make changes to the file. Then press ESC when done and ZZ to save and exit.)

And then run the SSH command with the addition of the -t switch:

ssh -t -i FILENAME.pem [email protected] su --session-command="./update.sh"

Judicator answered 2/1, 2013 at 16:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.