1

I have a Linux-VPS, using it as GIT- and HTTP-Server.

HTTP: Apache

Git-server: git-http-backend via vhost

When I log me in via SSH, everything is fine.
But if I open a second SSH-Connection, I get this error:

stdin: is not a tty

I use ssh for years and have never seen such an error. I searched around for over 1.5 hours...

While I wrote this, the error got even more strange — now the error comes on every connection!

I haven't found any solution that helped me.

I'm using:

  • Windows
  • Secure Shell Client (quite outdated, but much nicer than putty)
7
  • Try ssh -t or even ssh -tt. Nov 11, 2014 at 15:51
  • I added new Information. If i try in putty (plink), not even -t , -t -t or sth works, already tried it.
    – Mijago
    Nov 11, 2014 at 16:02
  • I don't think plink has a -t option to force a pseudo-tty, which explains why it didn't work. If things are getting worse, have you considered a reboot? Nov 11, 2014 at 16:10
  • Yes, many times.. Yesterday i had the same issue and after a few reboots and tries I reinstalled the VM, but as we see it doesnt help
    – Mijago
    Nov 11, 2014 at 16:13
  • Try putty instead. Apparently, there is a SSH tree on the left where you can control pseudo-tty allocation. I don't use it myself, so can't confirm/deny :-) Nov 11, 2014 at 16:21

1 Answer 1

0

For reasons I do not understand (but see later), your shell is not set to interactive; just issue, on the remote server,

  bash -i 

this will make the shell interactive and you will be good to go. At this point you may have to source your .bashrc file, because the standard ones are often provided with the following lines, located just at the top of the file:

 case $- in
          *i*) ;;
           *) return;;
 esac

This checks whether among the shell flags ($-) there is an i, for interactive; if it is not present, it skips sourcing the file. hence the need to now run

 source ~/.bashrc

which will give you your standard environment. I strongly discourage you from executing bash -i automatically, for instance inside your .bashrc file: executing an automatic script that sets the shell to interactive is an oxymoron, and is equivalent to pointing a loaded gun to your temple.

As to why this error message arises, I can only speculate:

  1. your ISP allows a small number of simultaneous PTYs to be allocated to each user; it is for instance GitHub's policy (it allows zero PTYs), but cannot really see the advantage in allowing a small, but non-zero number. But then, there may be someone smarter than I who can cast a light on this...

  2. you are trying to ssh from within a reverse shell, a well-known problem to pentesters. There are ways around it.

  3. it is something related to either the oldish version of Secure Shell Client you are using, or to Windows, but in either case I can be of little help.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .