LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Different SSH (https://www.linuxquestions.org/questions/linux-newbie-8/different-ssh-876033/)

hks1233 04-19-2011 11:39 PM

Different SSH
 
Hi All

Is it possible to switch to different ssh in LINUX

Regards
Hks1233

varunb 04-19-2011 11:49 PM

Quote:

Originally Posted by hks1233 (Post 4330086)
Hi All

Is it possible to switch to different ssh in LINUX

Regards
Hks1233


hi

what do you mean by switch ssh???
are you trying to say to login/switch to different PC through ssh??

anyways command to login to other PC through your PC is
# ssh -x <username>@<IP address>

hks1233 04-20-2011 12:19 AM

Hi Varunb

am looking for switching on different ssh session on same Linux box not to a different one.


Regards
Hks1233

brownie_cookie 04-20-2011 12:42 AM

if i understand your problem right, you can do the following

Code:

ssh user@host 'commando1; commando2; commandon'            (this is session one)
ssh user@host 'commando1; commando2; commandon'            (this is session two on the same host)

you can replace the commando1, ... with commands like: ls, grep, if-then-else, find, .......

But if you don't mean this, then (i geuss) you need to clearify your problem a little bit more...

hks1233 04-20-2011 01:26 AM

Hi All

consider the situation of having a Linux box . And made connection to the box from a machine using session shh1 and connected to the same Linux box using session ssh2....

Is there any way to switch from session ssh1 to ssh2


Thanks
hks1233

evo2 04-20-2011 01:47 AM

Hi,

You could use screen or tmux but would need to set it up from the initial shell (ie "ssh1") in order to attach to that shell from the second ssh (ie "ssh2").

For random tutorials see for example:
- For screen: http://news.softpedia.com/news/GNU-S...al-44274.shtml
- For tmux: http://blog.hawkhost.com/2010/06/28/...l-multiplexer/

(these are just two of the links that came up when I searched duckduckgo.com for "screen tutorial" and "tmux tutorial")

There also used to be a program called "retty" that would allow you to steal control of terminal programs... I think it was a little buggy though and may not be available for most distros.

Cheers,

Evo2.

PS. Your use of "ssh1" and "ssh2" terminology may have been a little confusing to some, since "ssh1" and "ssh2" usually refer to the two different protocol versions of ssh.


All times are GMT -5. The time now is 08:52 PM.