ssh into server from desktop & run program X, later ssh into server from laptop & interact with X [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite













This question already has an answer here:



  • Keep SSH Sessions running after disconnection

    8 answers



I'm sure this is a very basic question. I assume tmux could facilitate this, but I'm not sure of the exact steps.



My use-case is:



I'm sitting at my desktop and I ssh into a server. I start a long-running process. The process continues running on the server while I do other things (but I do not necessarily detach from the server at this time).



Now I'm on my laptop. (Say I went to lunch.) I need to ssh into that same server, see the same console output I would see on my desktop if I were there, and send some keystrokes to that same still-running application. I need to interact with it exactly as if I were still at my desktop ssh session. When finished, I will detach from this session and allow the application to continue running on the server.



Later, I will check on it from my desktop at work. At the end of the work day I will detach from it and go home. (Now no sessions at attached to the process on the server.) At home I will connect to the server and attach to the same still-running application, see what is on the screen and possibly send it some commands.



tmux seems to have such a focus on terminal multiplexing that my use-case is not explained in the answers or tutorials I have found so far. My use-case appears to be almost the opposite. I do not need to sit at one screen and connect to multiple servers. I will be working on one server, but connecting to it from multiple different computers, sometimes having multiple connections open at once, sometimes having no connections at all, and my focus is interacting with one long-running application on the server.



What are the steps to connect to the server and start my console application, then connect to that same application and see the same console output from multiple other computers?



Also, does tmux have to be installed on clients and the server?










share|improve this question















marked as duplicate by muru, Isaac, Goro, RalfFriedl, dirkt Oct 1 at 10:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • @muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
    – MountainX
    Oct 1 at 3:07










  • XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
    – muru
    Oct 1 at 3:10











  • @muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
    – MountainX
    Oct 1 at 3:22






  • 2




    How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
    – muru
    Oct 1 at 3:23






  • 1




    tmux covered by unix.stackexchange.com/a/242832/70524
    – muru
    Oct 1 at 4:43














up vote
1
down vote

favorite













This question already has an answer here:



  • Keep SSH Sessions running after disconnection

    8 answers



I'm sure this is a very basic question. I assume tmux could facilitate this, but I'm not sure of the exact steps.



My use-case is:



I'm sitting at my desktop and I ssh into a server. I start a long-running process. The process continues running on the server while I do other things (but I do not necessarily detach from the server at this time).



Now I'm on my laptop. (Say I went to lunch.) I need to ssh into that same server, see the same console output I would see on my desktop if I were there, and send some keystrokes to that same still-running application. I need to interact with it exactly as if I were still at my desktop ssh session. When finished, I will detach from this session and allow the application to continue running on the server.



Later, I will check on it from my desktop at work. At the end of the work day I will detach from it and go home. (Now no sessions at attached to the process on the server.) At home I will connect to the server and attach to the same still-running application, see what is on the screen and possibly send it some commands.



tmux seems to have such a focus on terminal multiplexing that my use-case is not explained in the answers or tutorials I have found so far. My use-case appears to be almost the opposite. I do not need to sit at one screen and connect to multiple servers. I will be working on one server, but connecting to it from multiple different computers, sometimes having multiple connections open at once, sometimes having no connections at all, and my focus is interacting with one long-running application on the server.



What are the steps to connect to the server and start my console application, then connect to that same application and see the same console output from multiple other computers?



Also, does tmux have to be installed on clients and the server?










share|improve this question















marked as duplicate by muru, Isaac, Goro, RalfFriedl, dirkt Oct 1 at 10:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • @muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
    – MountainX
    Oct 1 at 3:07










  • XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
    – muru
    Oct 1 at 3:10











  • @muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
    – MountainX
    Oct 1 at 3:22






  • 2




    How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
    – muru
    Oct 1 at 3:23






  • 1




    tmux covered by unix.stackexchange.com/a/242832/70524
    – muru
    Oct 1 at 4:43












up vote
1
down vote

favorite









up vote
1
down vote

favorite












This question already has an answer here:



  • Keep SSH Sessions running after disconnection

    8 answers



I'm sure this is a very basic question. I assume tmux could facilitate this, but I'm not sure of the exact steps.



My use-case is:



I'm sitting at my desktop and I ssh into a server. I start a long-running process. The process continues running on the server while I do other things (but I do not necessarily detach from the server at this time).



Now I'm on my laptop. (Say I went to lunch.) I need to ssh into that same server, see the same console output I would see on my desktop if I were there, and send some keystrokes to that same still-running application. I need to interact with it exactly as if I were still at my desktop ssh session. When finished, I will detach from this session and allow the application to continue running on the server.



Later, I will check on it from my desktop at work. At the end of the work day I will detach from it and go home. (Now no sessions at attached to the process on the server.) At home I will connect to the server and attach to the same still-running application, see what is on the screen and possibly send it some commands.



tmux seems to have such a focus on terminal multiplexing that my use-case is not explained in the answers or tutorials I have found so far. My use-case appears to be almost the opposite. I do not need to sit at one screen and connect to multiple servers. I will be working on one server, but connecting to it from multiple different computers, sometimes having multiple connections open at once, sometimes having no connections at all, and my focus is interacting with one long-running application on the server.



What are the steps to connect to the server and start my console application, then connect to that same application and see the same console output from multiple other computers?



Also, does tmux have to be installed on clients and the server?










share|improve this question
















This question already has an answer here:



  • Keep SSH Sessions running after disconnection

    8 answers



I'm sure this is a very basic question. I assume tmux could facilitate this, but I'm not sure of the exact steps.



My use-case is:



I'm sitting at my desktop and I ssh into a server. I start a long-running process. The process continues running on the server while I do other things (but I do not necessarily detach from the server at this time).



Now I'm on my laptop. (Say I went to lunch.) I need to ssh into that same server, see the same console output I would see on my desktop if I were there, and send some keystrokes to that same still-running application. I need to interact with it exactly as if I were still at my desktop ssh session. When finished, I will detach from this session and allow the application to continue running on the server.



Later, I will check on it from my desktop at work. At the end of the work day I will detach from it and go home. (Now no sessions at attached to the process on the server.) At home I will connect to the server and attach to the same still-running application, see what is on the screen and possibly send it some commands.



tmux seems to have such a focus on terminal multiplexing that my use-case is not explained in the answers or tutorials I have found so far. My use-case appears to be almost the opposite. I do not need to sit at one screen and connect to multiple servers. I will be working on one server, but connecting to it from multiple different computers, sometimes having multiple connections open at once, sometimes having no connections at all, and my focus is interacting with one long-running application on the server.



What are the steps to connect to the server and start my console application, then connect to that same application and see the same console output from multiple other computers?



Also, does tmux have to be installed on clients and the server?





This question already has an answer here:



  • Keep SSH Sessions running after disconnection

    8 answers







ssh tmux






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 1 at 4:36

























asked Oct 1 at 2:45









MountainX

4,7562369120




4,7562369120




marked as duplicate by muru, Isaac, Goro, RalfFriedl, dirkt Oct 1 at 10:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by muru, Isaac, Goro, RalfFriedl, dirkt Oct 1 at 10:38


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • @muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
    – MountainX
    Oct 1 at 3:07










  • XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
    – muru
    Oct 1 at 3:10











  • @muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
    – MountainX
    Oct 1 at 3:22






  • 2




    How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
    – muru
    Oct 1 at 3:23






  • 1




    tmux covered by unix.stackexchange.com/a/242832/70524
    – muru
    Oct 1 at 4:43
















  • @muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
    – MountainX
    Oct 1 at 3:07










  • XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
    – muru
    Oct 1 at 3:10











  • @muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
    – MountainX
    Oct 1 at 3:22






  • 2




    How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
    – muru
    Oct 1 at 3:23






  • 1




    tmux covered by unix.stackexchange.com/a/242832/70524
    – muru
    Oct 1 at 4:43















@muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
– MountainX
Oct 1 at 3:07




@muru the accepted answer there does not seem to address my use-case (especially for reconnecting or for viewing same console output from different computers). Also, from the little I know, tmux seems to be the most popular tool but it receives little attention at that question. Finally, I am requesting a few simple steps to accomplish a specific task which is different from that question.
– MountainX
Oct 1 at 3:07












XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
– muru
Oct 1 at 3:10





XY problem. Note both OP there and you want to keep some program running and then later check the progress. The second answer there has "a few simple steps" to accomplish this specific task with screen. And another answer covers the difference for tmux. (The steps are same for screen and tmux, only the specific options and keybindings differ)
– muru
Oct 1 at 3:10













@muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
– MountainX
Oct 1 at 3:22




@muru I posted a simple answer. It wasn't as hard as I anticipated. If you still think this question doesn't belong, let me know and I'll delete it.
– MountainX
Oct 1 at 3:22




2




2




How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
– muru
Oct 1 at 3:23




How unsurprisingly similar to unix.stackexchange.com/a/480/70524.
– muru
Oct 1 at 3:23




1




1




tmux covered by unix.stackexchange.com/a/242832/70524
– muru
Oct 1 at 4:43




tmux covered by unix.stackexchange.com/a/242832/70524
– muru
Oct 1 at 4:43










1 Answer
1






active

oldest

votes

















up vote
2
down vote













I decided to use tmux. I do not believe nohup long-running-process & meets my requirements. I gave tmux a try and it does work as desired. It appears that in my use-case tmux is only required to be installed on the server.




  1. I'm sitting at my desktop at work:



    $ ssh my_server

    $ tmux new-session -s my_session_name

    $ application_name #to start the long-running application and view its output on the console




  2. Now I'm on my laptop. (Say I went to lunch.):



    $ ssh my_server

    $ tmux attach-session my_session_name

    view console output of same application_name

    issue keystrokes as required

    ctrl-b d # to detach tmux session

    $ exit # to disconnect ssh session




  3. At the end of the work day I will detach from it and go home:



    ctrl-b d

    $ exit




  4. At home I will connect to the server:



    $ ssh my_server

    $ tmux attach-session my_session_name

    view console output of application_name

    issue keystrokes as required

    ctrl-b d

    $ exit



Next morning at work, reconnect the same way.






share|improve this answer





























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    I decided to use tmux. I do not believe nohup long-running-process & meets my requirements. I gave tmux a try and it does work as desired. It appears that in my use-case tmux is only required to be installed on the server.




    1. I'm sitting at my desktop at work:



      $ ssh my_server

      $ tmux new-session -s my_session_name

      $ application_name #to start the long-running application and view its output on the console




    2. Now I'm on my laptop. (Say I went to lunch.):



      $ ssh my_server

      $ tmux attach-session my_session_name

      view console output of same application_name

      issue keystrokes as required

      ctrl-b d # to detach tmux session

      $ exit # to disconnect ssh session




    3. At the end of the work day I will detach from it and go home:



      ctrl-b d

      $ exit




    4. At home I will connect to the server:



      $ ssh my_server

      $ tmux attach-session my_session_name

      view console output of application_name

      issue keystrokes as required

      ctrl-b d

      $ exit



    Next morning at work, reconnect the same way.






    share|improve this answer


























      up vote
      2
      down vote













      I decided to use tmux. I do not believe nohup long-running-process & meets my requirements. I gave tmux a try and it does work as desired. It appears that in my use-case tmux is only required to be installed on the server.




      1. I'm sitting at my desktop at work:



        $ ssh my_server

        $ tmux new-session -s my_session_name

        $ application_name #to start the long-running application and view its output on the console




      2. Now I'm on my laptop. (Say I went to lunch.):



        $ ssh my_server

        $ tmux attach-session my_session_name

        view console output of same application_name

        issue keystrokes as required

        ctrl-b d # to detach tmux session

        $ exit # to disconnect ssh session




      3. At the end of the work day I will detach from it and go home:



        ctrl-b d

        $ exit




      4. At home I will connect to the server:



        $ ssh my_server

        $ tmux attach-session my_session_name

        view console output of application_name

        issue keystrokes as required

        ctrl-b d

        $ exit



      Next morning at work, reconnect the same way.






      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        I decided to use tmux. I do not believe nohup long-running-process & meets my requirements. I gave tmux a try and it does work as desired. It appears that in my use-case tmux is only required to be installed on the server.




        1. I'm sitting at my desktop at work:



          $ ssh my_server

          $ tmux new-session -s my_session_name

          $ application_name #to start the long-running application and view its output on the console




        2. Now I'm on my laptop. (Say I went to lunch.):



          $ ssh my_server

          $ tmux attach-session my_session_name

          view console output of same application_name

          issue keystrokes as required

          ctrl-b d # to detach tmux session

          $ exit # to disconnect ssh session




        3. At the end of the work day I will detach from it and go home:



          ctrl-b d

          $ exit




        4. At home I will connect to the server:



          $ ssh my_server

          $ tmux attach-session my_session_name

          view console output of application_name

          issue keystrokes as required

          ctrl-b d

          $ exit



        Next morning at work, reconnect the same way.






        share|improve this answer














        I decided to use tmux. I do not believe nohup long-running-process & meets my requirements. I gave tmux a try and it does work as desired. It appears that in my use-case tmux is only required to be installed on the server.




        1. I'm sitting at my desktop at work:



          $ ssh my_server

          $ tmux new-session -s my_session_name

          $ application_name #to start the long-running application and view its output on the console




        2. Now I'm on my laptop. (Say I went to lunch.):



          $ ssh my_server

          $ tmux attach-session my_session_name

          view console output of same application_name

          issue keystrokes as required

          ctrl-b d # to detach tmux session

          $ exit # to disconnect ssh session




        3. At the end of the work day I will detach from it and go home:



          ctrl-b d

          $ exit




        4. At home I will connect to the server:



          $ ssh my_server

          $ tmux attach-session my_session_name

          view console output of application_name

          issue keystrokes as required

          ctrl-b d

          $ exit



        Next morning at work, reconnect the same way.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 1 at 3:34

























        answered Oct 1 at 3:21









        MountainX

        4,7562369120




        4,7562369120












            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay