ssh command returns “stdin: is not a tty”

If you run a command via ssh (secure shell) on linux and you get the following output:

stdin: is not a tty

The most common cause is the `mesg y` or similar command found in the file:

/etc/bashrc

###What is mesg ?

> mesg is a Unix command that sets or reports the permission other users have to write to your terminal using the talk and write commands.

###How can I fix this issue?

Option 1 would be to comment out the line.

Option 2 would be to change the line to something like this to only invoke the command when you are actually using a connection with `tty`:

if tty -s; then mesg y; fi

Related Posts:

  • No Related Posts
This entry was posted in Linux, Server Administration and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *