Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- ssh->sudo tcgetattr: Invalid argument
November 20, 2008, 7:11 pm
rate this thread
workstations. For the servers (mostly debian), I use something like
this (where rsyncSend contains: /usr/bin/rsync $*):
/usr/bin/ssh -pXXXX -q -x -l backup tobe.backedup.com sudo /var/
Recently some CentOS boxes have been thrown into the mix. With the
above command, I get:
Got remote protocol 1868854643
Fatal error (bad version): sudo: sorry, you must have a tty to run
Reading the man page of ssh, I figure it makes sense to add -t to
create a tty on the remote system:
/usr/bin/ssh -t -pXXXX -q -x -l backup tobe.backedup.com sudo /var/
I get the same error, so decide it's a good idea to add a second -t
since the ssh is not running from a tty on the local host:
/usr/bin/ssh -t -t -pXXXX -q -x -l backup tobe.backedup.com sudo /var/
Now I get a new error:
Got remote protocol 1701274484
Fatal error (bad version): tcgetattr: Invalid argument
I'm stuck at this point. This only happens on the CentOS servers.
And it only happens if the command is run from a process without a
tty, it works from the command line. I've disabled selinux on both
ends. Any ideas?
Thanks in advance,
- Nico Kadel-Garcia
November 21, 2008, 2:29 am
Re: ssh->sudo tcgetattr: Invalid argument
This is an RHEL 5 change. Cron jobs don't have an associated tty.
You can either edit the /etc/sudoers to comment out the line 'Defaults
requiretty' to allow non-tty connections, which I do *NOT* recommend, or use
service specific keys to access the target as root and restrict the commands
to rsync, like the 'validate-rsync' as described here:
- » Official release of OpenSSH with PermitPAMUserChange feature?
- — Next thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum