Bash Processes

Basically, can you create a new ssh session to a server (where there already say a putty session running) and operate using the same bash process?

Currently If I start a new connection then it starts a new bash process. So can this be done? Is there any benefit other than less processes? Or am I making a massive error here trying to do this. (couldn't find anything on google about this)

You may want to consider the screen package that allows to leave and reenter sessions. Please be aware that screen is not unanimously welcomed by the web community.

Thanks for the reply. This is the one thing I had found but did not want to use as I cannot install other programs and the screen command is deinfately not installed on the server I am using. (sorry should have said earlier)

If there is another way round or if anyone has any helpful info I am interested to hear.

I do not see an issue.

  1. you are using putty from a windows desktop
  2. open two separate putty windows, connect to where you want
  3. use Alt/Tab to switch processes. or:
  4. Reshape the windows using the cursor so that both sessions fit on the screen at one time.

You can change the title of the putty windows so you don't get confused:

export SERVER=$(hostname)
echo "setting putty title to $SERVER"
export EXTRA=":Stuff I need to see goes here"
PROMPT_COMMAND="\033]0;${SERVER}${EXTRA}\007"
echo $PROMPT_COMMAND

What am I missing?

Not sure if this is part of the question, but I did have a similar question. If you plan to log off of a session (where running processes in the background after a logoff doesn't work), can you go to another terminal and then pick up on the process that is running and continue it at the other terminal?

For example, if you have a cp (copy process) running can you keep logged in to the server you are running it on (serverA), and then attach to it from a different server (serverB) and keep it going? So I would have the cp running on serverA, attach to it on ServerB and then then log off of serverA and the process would still run?

Would a truss command allow you to hook up or help to do this? I know you can use screen and vm terminals, this is just curiosity.