VNC Server - securely forwards to the localhost connection for VNC











up vote
0
down vote

favorite












I followed this link https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04



and I created the VNC server in my remote VM, started the VNC server in it and pointed to my local machine using the



Create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. You can do this via the terminal on Linux or macOS with the following command:

ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_1 172.1.1.1


But when I point to my local machine it worked successfully. I am able to take the remote using VNC.



But when I login to some other machine and point the same remote machine to it, It failed to connect.



I am not able to see any error, It got stuck like this



/etc/test$ ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_2 172.1.1.1
testmachine_2@172.1.1.1's password:


Could someone let me know the possible reasons for it?










share|improve this question
























  • Try reverse SSH tunnel from the other machine.
    – Petar Vassilev
    Nov 16 at 21:09










  • @petar could you send me the command, I will try it in other machine
    – Harry
    Nov 16 at 21:10















up vote
0
down vote

favorite












I followed this link https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04



and I created the VNC server in my remote VM, started the VNC server in it and pointed to my local machine using the



Create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. You can do this via the terminal on Linux or macOS with the following command:

ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_1 172.1.1.1


But when I point to my local machine it worked successfully. I am able to take the remote using VNC.



But when I login to some other machine and point the same remote machine to it, It failed to connect.



I am not able to see any error, It got stuck like this



/etc/test$ ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_2 172.1.1.1
testmachine_2@172.1.1.1's password:


Could someone let me know the possible reasons for it?










share|improve this question
























  • Try reverse SSH tunnel from the other machine.
    – Petar Vassilev
    Nov 16 at 21:09










  • @petar could you send me the command, I will try it in other machine
    – Harry
    Nov 16 at 21:10













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I followed this link https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04



and I created the VNC server in my remote VM, started the VNC server in it and pointed to my local machine using the



Create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. You can do this via the terminal on Linux or macOS with the following command:

ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_1 172.1.1.1


But when I point to my local machine it worked successfully. I am able to take the remote using VNC.



But when I login to some other machine and point the same remote machine to it, It failed to connect.



I am not able to see any error, It got stuck like this



/etc/test$ ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_2 172.1.1.1
testmachine_2@172.1.1.1's password:


Could someone let me know the possible reasons for it?










share|improve this question















I followed this link https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04



and I created the VNC server in my remote VM, started the VNC server in it and pointed to my local machine using the



Create an SSH connection on your local computer that securely forwards to the localhost connection for VNC. You can do this via the terminal on Linux or macOS with the following command:

ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_1 172.1.1.1


But when I point to my local machine it worked successfully. I am able to take the remote using VNC.



But when I login to some other machine and point the same remote machine to it, It failed to connect.



I am not able to see any error, It got stuck like this



/etc/test$ ssh -L 5901:127.0.0.1:5901 -C -N -l testmachine_2 172.1.1.1
testmachine_2@172.1.1.1's password:


Could someone let me know the possible reasons for it?







linux ubuntu vnc vncviewer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 at 20:18









Rui F Ribeiro

38.2k1475123




38.2k1475123










asked Nov 16 at 20:15









Harry

1125




1125












  • Try reverse SSH tunnel from the other machine.
    – Petar Vassilev
    Nov 16 at 21:09










  • @petar could you send me the command, I will try it in other machine
    – Harry
    Nov 16 at 21:10


















  • Try reverse SSH tunnel from the other machine.
    – Petar Vassilev
    Nov 16 at 21:09










  • @petar could you send me the command, I will try it in other machine
    – Harry
    Nov 16 at 21:10
















Try reverse SSH tunnel from the other machine.
– Petar Vassilev
Nov 16 at 21:09




Try reverse SSH tunnel from the other machine.
– Petar Vassilev
Nov 16 at 21:09












@petar could you send me the command, I will try it in other machine
– Harry
Nov 16 at 21:10




@petar could you send me the command, I will try it in other machine
– Harry
Nov 16 at 21:10










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You are getting asked for the password because you are on a machine that does not have the login information stored yet. Put the password in for testmachine_2 on remote machine and press enter, this will unlock the keyring for the first connect on that machine. However I would suggest getting private and public keys working insted of passwords. If no password was set use that users login password.






share|improve this answer








New contributor




Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f482237%2fvnc-server-securely-forwards-to-the-localhost-connection-for-vnc%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













    You are getting asked for the password because you are on a machine that does not have the login information stored yet. Put the password in for testmachine_2 on remote machine and press enter, this will unlock the keyring for the first connect on that machine. However I would suggest getting private and public keys working insted of passwords. If no password was set use that users login password.






    share|improve this answer








    New contributor




    Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      0
      down vote













      You are getting asked for the password because you are on a machine that does not have the login information stored yet. Put the password in for testmachine_2 on remote machine and press enter, this will unlock the keyring for the first connect on that machine. However I would suggest getting private and public keys working insted of passwords. If no password was set use that users login password.






      share|improve this answer








      New contributor




      Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        0
        down vote










        up vote
        0
        down vote









        You are getting asked for the password because you are on a machine that does not have the login information stored yet. Put the password in for testmachine_2 on remote machine and press enter, this will unlock the keyring for the first connect on that machine. However I would suggest getting private and public keys working insted of passwords. If no password was set use that users login password.






        share|improve this answer








        New contributor




        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        You are getting asked for the password because you are on a machine that does not have the login information stored yet. Put the password in for testmachine_2 on remote machine and press enter, this will unlock the keyring for the first connect on that machine. However I would suggest getting private and public keys working insted of passwords. If no password was set use that users login password.







        share|improve this answer








        New contributor




        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered Nov 17 at 5:25









        Michael Prokopec

        1738




        1738




        New contributor




        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Michael Prokopec is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482237%2fvnc-server-securely-forwards-to-the-localhost-connection-for-vnc%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

            Morgemoulin

            Scott Moir

            Souastre