LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   ssh sending commands to actual terminal (http://www.linuxquestions.org/questions/slackware-14/ssh-sending-commands-to-actual-terminal-4175433764/)

fatalerror0x00 10-23-2012 10:44 PM

ssh sending commands to actual terminal
 
So i need to know how to send a command to like run a program on my computer over ssh. Now heres where I run into a problem. When you do it normally it opens in your session of ssh. soon as your done with your ssh connection the program dies. I need a way to run this program without it dying unless I specifically tell it to die or it crashes. Thank you!

TracyTiger 10-23-2012 11:03 PM

I understand that the program screen is supposed to be excellent for keeping a terminal session open after the communications have been disconnected. You can come back later and "re-enter" the terminal session.

I haven't used it myself however.

fatalerror0x00 10-23-2012 11:58 PM

Screen
 
I had just played around with that minutes before I just checked this thread and I seem to be running into the issue of moving away from the screen in my ssh session so I still can't do anything else either in my session unless I want to run another session but isn't screen supposed to be the solution to that issue? lol
Also another issue is I can get screen to come up on my linux machine to see what i can over ssh now but trying to figure out how to get away from that screen and back to my tty1. I think I saw a guide earlier with this information all in it or even maybe if i'd try alt + f1 or something I'll try those. So currently now I need to figure out how to move away from the screen after I launch a program with it so that i can continue to do other stuff other then that the ssh side of this issue will be resolved. :)

fatalerror0x00 10-24-2012 12:01 AM

Also when on my desktop (assuming this first part) If i'm not in my gui I don't enjoy the size of the terminal so if I was in x i'm assuming it would look better. Second part is alt +f1 didn't get me out alt f2 did but i guess that solves that on the desktop side this issue was my own stupidity :P. Now I need to figure out how to make it look better on the desktop side any ideas? Also I still need to figure out how to move away from screen in my ssh window. Thank you :)

fatalerror0x00 10-24-2012 12:30 AM

Got it now I figured out screen enough that I think I'm all set for a while :) Thanks :)

astrogeek 10-24-2012 12:53 AM

You can also do that with nohup ("no hangup")

nohup scriptname &

The script will continue to run after you logout.

See man nohup for details.

fatalerror0x00 10-24-2012 12:59 AM

Okay i'll look into tthat now I do have one question now about screen how can i send a command to it without it displaying everything i typed (like I did the screen -X -S (NAMEOFSESSION) stop (stop is a command to stop a file my script runs) but if i remember correctly the entire thing i typed in was outputted instead of just stop so my server didn't recognize the command. How could I fix this? Thanks :)


All times are GMT -5. The time now is 09:41 PM.