5

I watched the The Black Magic Of SSH video and lecturer in this video drops to SSH shell with some key-combination. How did he do that?

2
  • 1
    add the time of the video to see that.
    – maniat1k
    Sep 16, 2014 at 22:11
  • @maniat1k, his link has the timestamp in it. If that isn't working, it's right at the 10 minute mark.
    – BowlOfRed
    Sep 16, 2014 at 23:36

1 Answer 1

8

If you are talking about openssh, you can get a menu of ssh escapes by using the 3-key keystroke sequence <ENTER>~?.

$ ~?
Supported escape sequences:
~.  - terminate connection
~B  - send a BREAK to the remote system
~C  - open a command line
~R  - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~#  - list forwarded connections
~&  - background ssh (when waiting for connections to terminate)
~?  - this message
~~  - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)

This shows that <ENTER>~C will drop you to a ssh command line. From there, you can manage some port forwarding.

$ ~C
ssh> ?
Commands:
      -Lport:host:hostport    Request local forward
      -Rport:host:hostport    Request remote forward
      -KRhostport             Cancel remote forward

Otherwise you could drop to your local shell with <ENTER>~^Z.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .