“PTY allocation request failed” error when trying to connect using SSH with ControlMaster











up vote
3
down vote

favorite












I'm trying to log into Ubuntu desktop. I get the following error message:




PTY allocation request failed




What does it mean and how to connect to my desktop?



This is the output with -v:



debug1: Reading configuration data /home/evag/.ssh/config  
debug1: /home/evag/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
PTY allocation request failed




Given the output presented above with the verbose option, I think I understand where the problem comes from: I have two computers, A and B. I'm using a controlmaster in A to keep persistent connections to B. A logs into B in a safe way, with command=/bin/false to limit the usage A has on B (it has only forwarding capabilities).



However I would want to connect to ssh from A to B without using this identity (-i), but the problem is that since there is a persistent connection, it uses the existing connection regardless of the option I put in -i, so I end up with not being able to allocate a PTY.



So given that there is an existing controlmaster and protected connection from A to B, how can I get another connection from A to B, but this time with full rights?










share|improve this question
























  • Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
    – hexafraction
    Jul 9 '12 at 11:51






  • 1




    No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
    – evaG
    Jul 9 '12 at 12:18










  • I'll look for a guide when I have time.
    – hexafraction
    Jul 9 '12 at 12:20















up vote
3
down vote

favorite












I'm trying to log into Ubuntu desktop. I get the following error message:




PTY allocation request failed




What does it mean and how to connect to my desktop?



This is the output with -v:



debug1: Reading configuration data /home/evag/.ssh/config  
debug1: /home/evag/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
PTY allocation request failed




Given the output presented above with the verbose option, I think I understand where the problem comes from: I have two computers, A and B. I'm using a controlmaster in A to keep persistent connections to B. A logs into B in a safe way, with command=/bin/false to limit the usage A has on B (it has only forwarding capabilities).



However I would want to connect to ssh from A to B without using this identity (-i), but the problem is that since there is a persistent connection, it uses the existing connection regardless of the option I put in -i, so I end up with not being able to allocate a PTY.



So given that there is an existing controlmaster and protected connection from A to B, how can I get another connection from A to B, but this time with full rights?










share|improve this question
























  • Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
    – hexafraction
    Jul 9 '12 at 11:51






  • 1




    No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
    – evaG
    Jul 9 '12 at 12:18










  • I'll look for a guide when I have time.
    – hexafraction
    Jul 9 '12 at 12:20













up vote
3
down vote

favorite









up vote
3
down vote

favorite











I'm trying to log into Ubuntu desktop. I get the following error message:




PTY allocation request failed




What does it mean and how to connect to my desktop?



This is the output with -v:



debug1: Reading configuration data /home/evag/.ssh/config  
debug1: /home/evag/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
PTY allocation request failed




Given the output presented above with the verbose option, I think I understand where the problem comes from: I have two computers, A and B. I'm using a controlmaster in A to keep persistent connections to B. A logs into B in a safe way, with command=/bin/false to limit the usage A has on B (it has only forwarding capabilities).



However I would want to connect to ssh from A to B without using this identity (-i), but the problem is that since there is a persistent connection, it uses the existing connection regardless of the option I put in -i, so I end up with not being able to allocate a PTY.



So given that there is an existing controlmaster and protected connection from A to B, how can I get another connection from A to B, but this time with full rights?










share|improve this question















I'm trying to log into Ubuntu desktop. I get the following error message:




PTY allocation request failed




What does it mean and how to connect to my desktop?



This is the output with -v:



debug1: Reading configuration data /home/evag/.ssh/config  
debug1: /home/evag/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
PTY allocation request failed




Given the output presented above with the verbose option, I think I understand where the problem comes from: I have two computers, A and B. I'm using a controlmaster in A to keep persistent connections to B. A logs into B in a safe way, with command=/bin/false to limit the usage A has on B (it has only forwarding capabilities).



However I would want to connect to ssh from A to B without using this identity (-i), but the problem is that since there is a persistent connection, it uses the existing connection regardless of the option I put in -i, so I end up with not being able to allocate a PTY.



So given that there is an existing controlmaster and protected connection from A to B, how can I get another connection from A to B, but this time with full rights?







ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 '16 at 4:30









Josip Rodin

298111




298111










asked Jul 9 '12 at 8:18









evaG

1614




1614












  • Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
    – hexafraction
    Jul 9 '12 at 11:51






  • 1




    No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
    – evaG
    Jul 9 '12 at 12:18










  • I'll look for a guide when I have time.
    – hexafraction
    Jul 9 '12 at 12:20


















  • Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
    – hexafraction
    Jul 9 '12 at 11:51






  • 1




    No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
    – evaG
    Jul 9 '12 at 12:18










  • I'll look for a guide when I have time.
    – hexafraction
    Jul 9 '12 at 12:20
















Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
– hexafraction
Jul 9 '12 at 11:51




Stupid idea: What about setting up 2 SSH server instances independent of each other on different ports?
– hexafraction
Jul 9 '12 at 11:51




1




1




No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
– evaG
Jul 9 '12 at 12:18




No idea is stupid, thanks for the effort. It's probably not optimal but it's a nice workaround. However I don't know how to do that either, if you have a step by step guide that would be very helpful.
– evaG
Jul 9 '12 at 12:18












I'll look for a guide when I have time.
– hexafraction
Jul 9 '12 at 12:20




I'll look for a guide when I have time.
– hexafraction
Jul 9 '12 at 12:20










1 Answer
1






active

oldest

votes

















up vote
0
down vote













I'm assuming that you have specified the ControlPath and ControlMaster in ~/.ssh/config ? In which case ssh will always check for the ControlPath when attempting to access that server. As I understand it this is the default if a ControlPath exists even if ControlMaster=no is set (because it is automatically set to 'no' if the ControlPath exists so as not to attempt to create a new ControlMaster).



You will need to specify a new ControlPath:



ssh -o ControlPath=~/.ssh/%r@%h:%p-newsession server


However: I do the same thing but do not need to tell it to run 'false', I simply use the available options in SSH. See the man page for a way to create forwarding connections without starting a shell. When done properly the PTY is only allocated as needed, even over the same control connection.



-f      Requests ssh to go to background just before command execution.
-N Do not execute a remote command. This is useful for just forwarding ports.
-T Disable pseudo-tty allocation.


So in my case (along with other, unrelated options):



ssh -fNT server


where ~/.ssh/config already specifies the ControlPath.






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f161454%2fpty-allocation-request-failed-error-when-trying-to-connect-using-ssh-with-cont%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I'm assuming that you have specified the ControlPath and ControlMaster in ~/.ssh/config ? In which case ssh will always check for the ControlPath when attempting to access that server. As I understand it this is the default if a ControlPath exists even if ControlMaster=no is set (because it is automatically set to 'no' if the ControlPath exists so as not to attempt to create a new ControlMaster).



    You will need to specify a new ControlPath:



    ssh -o ControlPath=~/.ssh/%r@%h:%p-newsession server


    However: I do the same thing but do not need to tell it to run 'false', I simply use the available options in SSH. See the man page for a way to create forwarding connections without starting a shell. When done properly the PTY is only allocated as needed, even over the same control connection.



    -f      Requests ssh to go to background just before command execution.
    -N Do not execute a remote command. This is useful for just forwarding ports.
    -T Disable pseudo-tty allocation.


    So in my case (along with other, unrelated options):



    ssh -fNT server


    where ~/.ssh/config already specifies the ControlPath.






    share|improve this answer

























      up vote
      0
      down vote













      I'm assuming that you have specified the ControlPath and ControlMaster in ~/.ssh/config ? In which case ssh will always check for the ControlPath when attempting to access that server. As I understand it this is the default if a ControlPath exists even if ControlMaster=no is set (because it is automatically set to 'no' if the ControlPath exists so as not to attempt to create a new ControlMaster).



      You will need to specify a new ControlPath:



      ssh -o ControlPath=~/.ssh/%r@%h:%p-newsession server


      However: I do the same thing but do not need to tell it to run 'false', I simply use the available options in SSH. See the man page for a way to create forwarding connections without starting a shell. When done properly the PTY is only allocated as needed, even over the same control connection.



      -f      Requests ssh to go to background just before command execution.
      -N Do not execute a remote command. This is useful for just forwarding ports.
      -T Disable pseudo-tty allocation.


      So in my case (along with other, unrelated options):



      ssh -fNT server


      where ~/.ssh/config already specifies the ControlPath.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I'm assuming that you have specified the ControlPath and ControlMaster in ~/.ssh/config ? In which case ssh will always check for the ControlPath when attempting to access that server. As I understand it this is the default if a ControlPath exists even if ControlMaster=no is set (because it is automatically set to 'no' if the ControlPath exists so as not to attempt to create a new ControlMaster).



        You will need to specify a new ControlPath:



        ssh -o ControlPath=~/.ssh/%r@%h:%p-newsession server


        However: I do the same thing but do not need to tell it to run 'false', I simply use the available options in SSH. See the man page for a way to create forwarding connections without starting a shell. When done properly the PTY is only allocated as needed, even over the same control connection.



        -f      Requests ssh to go to background just before command execution.
        -N Do not execute a remote command. This is useful for just forwarding ports.
        -T Disable pseudo-tty allocation.


        So in my case (along with other, unrelated options):



        ssh -fNT server


        where ~/.ssh/config already specifies the ControlPath.






        share|improve this answer












        I'm assuming that you have specified the ControlPath and ControlMaster in ~/.ssh/config ? In which case ssh will always check for the ControlPath when attempting to access that server. As I understand it this is the default if a ControlPath exists even if ControlMaster=no is set (because it is automatically set to 'no' if the ControlPath exists so as not to attempt to create a new ControlMaster).



        You will need to specify a new ControlPath:



        ssh -o ControlPath=~/.ssh/%r@%h:%p-newsession server


        However: I do the same thing but do not need to tell it to run 'false', I simply use the available options in SSH. See the man page for a way to create forwarding connections without starting a shell. When done properly the PTY is only allocated as needed, even over the same control connection.



        -f      Requests ssh to go to background just before command execution.
        -N Do not execute a remote command. This is useful for just forwarding ports.
        -T Disable pseudo-tty allocation.


        So in my case (along with other, unrelated options):



        ssh -fNT server


        where ~/.ssh/config already specifies the ControlPath.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 17 '14 at 1:37









        Ken Sharp

        620622




        620622






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f161454%2fpty-allocation-request-failed-error-when-trying-to-connect-using-ssh-with-cont%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?