Issue with Pseudo terminal allocation with Openssh6.1p1

kawaljeet kaur kawaljeet.malviya at gmail.com
Thu Jun 20 12:28:17 EST 2013


Hi Openssh users ,

I am working on a client server application that involves extensive client
server interaction in a single ssh session. The application is also
required to capture all the Read , Write and Error Filehandles to work on
them separately as per the requirements of the application.
The ssh session had been using the flag '-T' to disable the message
'Pseudo-terminal will not be allocated because stdin is not a terminal'
until ssh of Openssh 5.4p1. However, ssh versions higher than this ( esp
6.1 ) is seen to be just displaying the same message 'Pseudo-terminal will
not be allocated because stdin is not a terminal' and hanging forever .
If executing in debug mode , it is seen to be hung at :
soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -T -v -v 10.5.68.68
"/tmp/test.sh "
.
.
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/soetest1/.ssh/identity ((nil))
debug2: key: /home/soetest1/.ssh/id_rsa (0x8429828)
debug2: key: /home/soetest1/.ssh/id_dsa ((nil))
debug1: Authentications that can continue:
publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/soetest1/.ssh/identity
debug1: Offering RSA public key: /home/soetest1/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp
17:b7:01:1e:39:29:f5:14:e6:67:1e:ab:ce:9c:10:11
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to 10.5.68.68 ([10.5.68.68]:22).
debug1: Requesting no-more-sessions at openssh.com
debug1: Entering interactive session.
^CKilled by signal 2.
[soetest1 at CSCRHEL62LGG32v ~]$

However , if we dont use '-T' flag or use '-t' flag , the application still
displays the same message 'Pseudo-terminal will not be allocated because
stdin is not a terminal' but is seen to go through and complete
successfully, with all versions of openssh.

I have tried the below few command line runs to explain myself , but i am
not sure whether they are appropriate to the situation or not:

*

Example 1 - non-interactive
*

Test script on remote host:

----------------------------------------

[root at CSCRHEL6LGGV ~]# cat /tmp/test3.sh

echo 'hello ssh'

[root at CSCRHEL6LGGV ~]#

Script execution on test host :

-------------------------------------------

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -T 10.5.68.68
"/tmp/test3.sh" 0>/tmp/errs2

hello ssh

[soetest1 at CSCRHEL62LGG32v ~]$ cat /tmp/errs2

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -T 10.5.68.68
"/tmp/test3.sh"

hello ssh

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -t 10.5.68.68
"/tmp/test3.sh"

hello ssh

Connection to 10.5.68.68 closed.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -t 10.5.68.68
"/tmp/test3.sh" 0>/tmp/errs2

Pseudo-terminal will not be allocated because stdin is not a terminal.

hello ssh

[soetest1 at CSCRHEL62LGG32v ~]$ cat /tmp/errs2

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -t 10.5.68.68
"/tmp/test3.sh" 0>/tmp/errs2

Pseudo-terminal will not be allocated because stdin is not a terminal.

hello ssh

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -t 10.5.68.68
"/tmp/test3.sh"

hello ssh

Connection to 10.5.68.68 closed.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -T 10.5.68.68
"/tmp/test3.sh"

^CKilled by signal 2.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -T 10.5.68.68
"/tmp/test3.sh" 0>/tmp/errs2

^CKilled by signal 2.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh 10.5.68.68 "/tmp/test3.sh"

hello ssh

*

Example 2 - interactive
*

Test script on remote host:

---------------------------------------

[root at CSCRHEL6LGGV ~]# cat /tmp/test.sh

read -p "enter name:" name; echo "your name is $name"

[root at CSCRHEL6LGGV ~]#

Script execution on test host :

-------------------------------------------

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh 10.5.68.68 "/tmp/test.sh"

^CKilled by signal 2.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -t 10.5.68.68
"/tmp/test.sh"

enter name:test

your name is test

Connection to 10.5.68.68 closed.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -t 10.5.68.68
"/tmp/test.sh" 0>/tmp/errs2

Pseudo-terminal will not be allocated because stdin is not a terminal.

your name is

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -T 10.5.68.68
"/tmp/test.sh" 0>/tmp/errs2

your name is

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_5.4p1/bin/ssh -T 10.5.68.68
"/tmp/test.sh"

^CKilled by signal 2.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -T 10.5.68.68
"/tmp/test.sh" 0>/tmp/errs2

^CKilled by signal 2.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -t 10.5.68.68
"/tmp/test.sh"

enter name:hello

your name is hello

Connection to 10.5.68.68 closed.

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh -t 10.5.68.68
"/tmp/test.sh" 0>/tmp/errs2

Pseudo-terminal will not be allocated because stdin is not a terminal.

your name is

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh 10.5.68.68 "/tmp/test.sh"
0>/tmp/errs2

your name is

[soetest1 at CSCRHEL62LGG32v ~]$ ./ssh_6.1p1/bin/ssh 10.5.68.68 "/tmp/test.sh"
^CKilled by signal 2.
 Please help.
Regards
Kawaljeet


More information about the openssh-unix-dev mailing list