Suppress 'Warning: no access to tty' in ssh

0

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:

ssh -T user@server << EOF
cd cs4400/$dest
gcc -o $efile $file
./$efile
EOF

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

Warning: no access to tty (Bad file descriptor).
Thus no job control in this shell.

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:

OpenSSH_6.1p1 Debian-4, OpenSSL 1.0.1c 10 May 2012

This version of tcsh on the server:

tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-unknown-linux)

And this version of ssh on the server:

OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010

blaineh

Posted 2013-09-17T17:17:09.847

Reputation: 111

Answers

0

There appears to be nothing that is specific to tcsh in your script, so just circumvent it. Example:

ssh -T user@server "/bin/bash -ec 'cd cs4400/$dest ; gcc -o $efile $file ; ./$efile'"

Daniel Beck

Posted 2013-09-17T17:17:09.847

Reputation: 98 421

Sanity check: the ;’s should be replaced by &&’s. – Scott – 2013-09-17T18:57:40.663

1@Scott Thought about that, but decided to keep the original semantics at first. But you're right, so I added -e (set -o errexit), which is pretty much the same in this case. – Daniel Beck – 2013-09-17T19:28:40.473

0

The -T ssh option is disabling the forwarding of the local environment variables. Thus your TERM variable is either absent or undefined, in which case ssh cannot assign a proper pseudo terminal (pty), which usually means you cannot use command-line completion and command-line editing controls, etc. You can try to remedy the situation with: TERM=vt100 ssh -T user@server ...

Also check your envronment variables with: set and set -o.

not2qubit

Posted 2013-09-17T17:17:09.847

Reputation: 1 234