Skip to content
Advertisement

Suppress ‘Warning: no access to tty’ in ssh

I have a short simple script, that compiles a .c file and runs it on a remote server running tcsh and then just gives back control to my machine (this is for school, I need my programs to work properly on the lab computers but want to edit them etc. on my machine). It runs commands this way:

JavaScript

So far it works fine, but it gives this warning every time I do this:

JavaScript

I know this technically isn’t a problem, but it’s SUPER annoying. I’m trying to do school work, checking the output of my program etc., and this clutters everything, and I HATE it.

I’m running this version of ssh on my machine:

JavaScript

This version of tcsh on the server:

JavaScript

And this version of ssh on the server:

JavaScript

Advertisement

Answer

The message is actually printed by shell, in this case tcsh. You can use

JavaScript

to ensure that it belongs to tcsh itself.

It is related to ssh only very loosely, ie ssh in this case is just the trigger, not the cause.

You should either change your approach and not use HERE DOCUMENT. Instead place executable custom_script into /path/custom_script and run it via ssh.

JavaScript

Or, just run complex command as a oneliner.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement