0

After ssh'ing from my local PC to another PC say machine B is there a linux command I can invoke on machine B where I can see the exact ssh command I used to log into it?

Example

I'm on my PC but then I ssh into machine B which has glassfish. Part of the ssh command creates a tunnel so I can access the glassfish web console on my pc's web browser. This is the command I use:

ssh testuser@machineb.com -L 5000:machineb.com:4848

From there I can go to my pc's web browser and type localhost:5000 to get to the glassfish admin console.

There are times though that I log ssh using the command above and then I'll monitor the servers logs on the linux terminal and forget whats the port I used to tunnel, in the case above it would be port 5000.

Is there a linux command that I can use on machine B where I can see the ssh command that I used to connect to it?

With the purpose of this to simply see the tunneled port to my local pc so I can access the glassfish web browser.

Currently I just exit out of machine B and see my last command with the port to re-login but I was wondering if there's the way I mentioned without doing that.

CAMD_3441
  • 121

0 Answers0