PTY allocation request failed on channel 0

20/02/2009

Yesterday, I was trying to login to my machine and I got the following message:

PTY allocation request failed on channel 0

My prompt was stuck and I could not enter commands. This happened because -for some reason- the tty related devices(/dev/ptmx, /dev/pts) were not created or mounted on my machine. In order to get this problem resolved, I created and mounted the missing devices using the following commands:

rm -rf /dev/ptmx
mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
umount /dev/pts
rm -rf /dev/pts
mkdir /dev/pts
mount /dev/pts

In order to be able to execute commands you will have to login to your machine(isn’t this supposed to be the original problem :) ).
This will do the trick:

ssh user@host "/bin/bash -i"

My VPS is built on openVZ but I have seen this problem occur also in XEN machines.
Leave me a comment if this works for you!

There are 89 comments in this article:

  1. 5/01/2013Problem ssh'ing into Cross LFS on Raspberry Pi say:

    […] to login as root, a normal error, and one is the tty issue, which is not a normal error. Anyway, this suggests the problem is that the pts devices were not being created as needed. My hunch would be […]

  2. 11/01/2013vasanth say:

    Thanks !! It worked !!

  3. 26/02/2013kamome say:

    Hi, I don’t have a root password set on my VPS, using sudo, instead …

    [sudo] password for :

    If I type in the password, it is being displayed in plaintext. After executing:

    stdin: is not a tty

    As a normal user, of course, I don’t have write permission to anything interesting …
    Does anyone of you know of a way to solve this?

  4. 18/04/2013webnode.com say:

    It’s enormous that you are getting thoughts from this paragraph as well as from our argument made here.

  5. 18/04/2013Mittie say:

    Hi there, yes this article is in fact nice and I have learned lot of things
    from it about blogging. thanks.

  6. 29/04/2013iphone screen repair malaysia say:

    Woah! I’m really loving the template/theme of this site. It’s simple, yet effective.

    A lot of times it’s challenging to get that “perfect balance” between usability and visual appeal. I must say you’ve done a very good job with this.

    Also, the blog loads extremely fast for me on Internet
    explorer. Outstanding Blog!

  7. 15/05/2013wholesale bras say:

    PTY allocation request failed on channel 0 | Yak Shaving spiked Christian Louboutin sandals http://spikedchristianlouboutinsandals.weebly.com/

  8. 26/05/2013cellulite treatment say:

    Hello to all, how is all, I think every one is getting more from this website, and
    your views are fastidious in support of new visitors.

  9. 29/05/2013Hugo say:

    Wow, amazing weblog structure! How long have you ever been blogging
    for? you made blogging look easy. The overall glance
    of your site is wonderful, let alone the content!

  10. 31/05/2013macbook Repair kepong say:

    My relatives always say that I am killing my time here at net, but I know I am getting know-how daily
    by reading thes good posts.

  11. 1/06/2013wiredtree hosting 2013 say:

    Hi there friends, nice article and pleasant urging commented
    at this place, I am in fact enjoying by these.

  12. 1/06/2013ipad repair kepong say:

    Hey there, You have done a fantastic job. I’ll definitely digg it and personally suggest to my friends. I’m sure they will be benefited from this website.

  13. 3/06/2013iphone repair petaling jaya say:

    Link exchange is nothing else however it is only placing the other person’s web site link on your page at proper place and other person will also do same in support of you.

  14. 15/06/2013Wiredtree Review 2013 say:

    With havin so much content do you ever run into any problems of plagorism
    or copyright infringement? My website has a
    lot of exclusive content I’ve either authored myself or outsourced but it seems a lot of it is popping it up all over the web without my authorization. Do you know any ways to help prevent content from being ripped off? I’d
    genuinely appreciate it.

  15. 30/07/2013www.idsm-consulting.com say:

    Unless you have a higher excess, such as you.

    My car is worth less than £1, 000 each to insure their
    cars, yet they are hit with higher than average motor trade insurance
    (www.idsm-consulting.com) premiums. 7% in 2009 to above £1,
    000 to get insurance on a small Ford Fiesta.
    %random_anchor_text” %random_anchor_text” %random_anchor_text”
    %random_anchor_text” %random_anchor_text” %random_anchor_text”

  16. 14/12/2013taoofbadassonline.pw say:

    Hey There. I discovered your blog the usage of msn.
    This is a really smartly written article. I’ll make sure to bookmark it and come back to learn more of your helpful info.
    Thanks for the post. I will certainly return.

  17. 3/03/2014Glenn say:

    We are a group of volunteers and opening a new scheme in our community.
    Your website provided us with valuable info to work on.
    You have done a formidable job and our whole community will be grateful to you.
    Glenn

  18. 12/03/2014Google Links say:

    Hi,

    Are you TIRED of doing seo or getting it done ? Articles, Blogs, Comments, Web
    2.0, Social Bookmarking… all the efforts without any result ?

    After Penguin, Panda and Hummingbird Updates of GOOGLE the above things don’t work anymore.
    STOP WASTING your time and money on it !

    The latest 2014 technique is HERE, grab it before google rolls the next update
    !
    Sign Up for FREE here and TRY this today :

    http://binarytodecimal.com/google_links

    Bob

  19. 21/05/2014plusrencontre say:

    Greetings from Ohio! I’m bored to death at work so I decided to check out
    your site on my iphone during lunch break. I enjoy the knowledge
    you provide here and can’t wait to take a look when I get home.
    I’m shocked at how quick your blog loaded on my phone ..

    I’m not even using WIFI, just 3G .. Anyways, wonderful site!

    – plusrencontre
    – plusrencontre
    – plusrencontre
    – plusrencontre
    – plusrencontre
    – plusrencontre

  20. 17/07/2014cam girls say:

    I like the helpful information you provide in your articles.
    I will bookmark your blog and check again here frequently.
    I’m quite certain I will learn a lot of new stuff right here!
    Good luck for the next!

  21. 3/08/2014http://bestmattress2014.net/ say:

    Yes! Finally something about mattreses.

  22. 20/08/2014レッドウィング ブーツ アウトレット say:

    It’s really very complex in this busy life to listen news on Television, thus I
    simply use world wide web for that purpose, and obtain the
    newest news.

  23. 28/08/2014Bettyann say:

    Thanks for a marvelous posting! I definitely enjoyed reading it,
    you are a great author.I will always bookmark your blog
    and will often come back very soon. I want to encourage
    continue your great writing, have a nice day!

  24. 9/09/2014Caribbean-cruise say:

    Right here is the perfect website for anybody
    who hopes to understand this topic. You know a whole lot its almost tough to
    argue with you (not that I actually will need to…HaHa).
    You definitely put a fresh spin on a subject which has been written about
    for a long time. Excellent stuff, just great!

  25. 9/09/2014cruise say:

    This is very interesting, You’re a very skilled blogger.
    I’ve joined your feed and look forward to seeking more of your fantastic post.
    Also, I’ve shared your site in my social networks!

  26. 9/09/2014cheap-ticket say:

    Hello there, just became aware of your blog through Google, and
    found that it’s really informative. I am going to
    watch out for brussels. I will appreciate if you continue
    this in future. Numerous people will be benefited from your writing.

    Cheers!

  27. 30/09/2014Whirlpool Microwave Wmh31017As say:

    This paragraph is in fact a good one it helps
    new internet viewers, who are wishing in favor of blogging.

  28. 2/10/2014nike shoes on sale say:

    Hi there! I know this really is kind of off topic bbut I was wondering if you knew where I could gget a captcha pluyin for my comment
    form? I’m using the same blog platform as yours annd I’m obtaining difficulty finding
    1? Thanks quite a bit!

  29. 3/10/2014Bridget say:

    I’d like to thank you for the efforts you’ve put in penning this site.
    I am hoping to see the same high-grade content
    by you later on as well. In truth, your creative writing abilities has encouraged me to
    get my very own website now ;)

  30. 5/10/2014KIDS say:

    Powered by BI-SAM’s greatest-in-class B-One® performance calculation engine and underpinned by Broadridge’s Investment Management expertise, the solution provides complete performance reporting and absolute attribution analysis throughout multiple asset lessons
    and dimensions of the business, together with true time-weighted returns at multiple levels, inside charges
    of return at fund degree, benchmark comparisons and market segment
    decomposition.

  31. 12/11/2014Reg say:

    Worked like a charm! Straight and to the point. This drove me crazy for several days. Nice job & thanks for posting!!

  32. 26/11/2014laser etching service say:

    I have read so many articles regarding the blogger lovers except this post is truly a nice
    post, keep it up.

  33. 15/10/2015Ines say:

    wrote:Thats true, the weird thing is when I take out my XT sim and put in my Vodafone sim, everything fixes iltsef. It makes me wonder who is not following the proper standards, if there are any standards. Knowing the reputations of Apple and Telecom, the natural reaction is that Telecom is going take most of the bashing lol regardless of whose fault it is.(koruki has made 2 comments)Yes, because Vodafone are an official carrier. The problem *only occurs* when you insert a SIM card from an unofficial carrier. It has nothing to do with proper standards at all. The simple matter of fact is that when you put in a SIM card from an official carrier, the phone does different things to when you put in a SIM card from an unofficial carrier.In this case, it would appear that the things that the phone does when you have an unofficial carrier’s SIM card in results in a bug appearing. As mentioned above Apple are working on the problem and one would hope the problem is fixed in 5.0.1. I don’t see how Telecom should be taking any blame at all given that they have never sold the device, don’t support the device, and no other devices on their network exhibit the same problem.FWIW I cannot see how this could be the fault of Telecom. The bit that isn’t working is the part where the phone matches numbers to names. The carrier has no involvement in this process, not from a network level and not from a SIM card level. It is all in the phone software. The *only* way this could possibly be happening is if Apple has started relying on some weird field in the SIM card for some crucial piece of information, but I highly doubt this is the case this time around.As mentioned above, Apple are aware of the issue and they are working on a fix. That is all. Any anger towards Telecom is severely misdirected as there is so far absolutely no evidence that this has anything to do with their actions or inactions. In all likelihood Apple will fix the problem in a subsequent update without Telecom lifting a finger.(rdw11 has made 15 comments)

  34. 2/11/2015Apple:“PTY allocation request failed on channel 2” while using SSH – Apple Questions say:

    […] pty allocation request failed – 3rd […]

  35. 19/04/2016http://www.krums1.com/ say:

    Tip top stuff. I’ll expect more now.

  36. 29/04/2016http://www.sorethumbsblog.com/ say:

    Whoa, whoa to Anonymous who married in 1976 and it lasted 17 years. Those are my exact stats but it is not me and I want to clear it up for those who might know me. Ours didn't last but not because of cheating. He was a gambler, bad with money and had his priorities wrong. I really wanted it to last forever and wish he had been a different person because I enjoyed being married and now that I'm not I find good and bad things about that too. Aunt Danny

  37. 29/04/2016http://www.ionicbathfootdetox.com/ say:

    Eläinoikeusfoorumilla joku väitti tämän kemikaalin olevan yhteydessä couperosaan ja punoittavaan ihoon. Olisi kiva tietää, onko todella näin.. Itselläni on couperosaa, ja vaikka suurin osa käyttämistäni tuotteista on merkkejä LV, Erisan sekä herkän ihon tuotteita, niissä kaikissa on sodium laureth sulfatea. Eikö tätä ainesosaa luonnonkosmetiikassa ole?

  38. 29/04/2016http://www.blrimages.net/ say:

    On oublie aussi de dire que la mentalité des « voyageurs » a considérablement évoluée ces dernières décennies et pas seulement à cause de la sédentarisation forcée.Une grande majorité d’entre eux a compris qu’ils devaient se débarrasser de la mauvaise réputation qui leur colle à la peau. Ils font l’effort et prennent l’initiative d’aller vers les « non-voyageurs », organisent et participent à des manifestations culturelles qui permettent de dépassionner la relation et aux uns et aux autres de se connaître.

  39. 7/05/2016http://www.iamastoryteller.org/ say:

    · I loved as much as you’ll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an shakiness over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this hike.

Write a comment: