Hack and / - Lightning Hacks--SSH Strikes Back
A lesser-known feature of SSH is that you can enter an internal command-line mode in an existing session and add extra tunnels. Let's say you already have an SSH session open from admin1 to londonweb1, and now you want to add the reverse tunnel without having to log out. First, press ~C (that's the ~ character and then a capital C) to open the SSH command line. Then, you can add extra port-forwarding commands as though they were part of the original SSH command line. When you are done, simply press Enter to return to the regular shell:
kyle@londonweb1:~$ ssh> -R 2222:seattleweb1:22 Forwarding port. kyle@londonweb1:~$
This also could be useful if you use regular SSH tunnels (the -L option) as a poor-man's VPN and realize that, for instance, you need to set up an extra VNC or RDP tunnel to a new server. When you use the SSH command line, you won't have to close and break any existing sessions you have.
Kyle Rankin is a Systems Architect in the San Francisco Bay Area and the author of a number of books, including The Official Ubuntu Server Book, Knoppix Hacks and Ubuntu Hacks. He is currently the president of the North Bay Linux Users' Group.
Kyle Rankin is a systems architect; and the author of DevOps Troubleshooting, The Official Ubuntu Server Book, Knoppix Hacks, Knoppix Pocket Reference, Linux Multimedia Hacks, and Ubuntu Hacks.
- Readers' Choice Awards 2013
- Linux Kernel News - November 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- RSS Feeds
- Sublime Text: One Editor to Rule Them All?
- Raspberry Pi: the Perfect Home Server
- Advanced Hard Drive Caching Techniques
- Web Administration Scripts
- IBM Will Minimize Impact of Future Disasters
- thanks for share, great
6 hours 3 min ago
- There are factors which are
11 hours 3 min ago
- Gnome 3 ?
11 hours 48 min ago
- Reply to comment | Linux Journal
15 hours 55 min ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 2 hours ago
- on the ground
1 day 8 hours ago
- I was able to read the whole
1 day 9 hours ago
- since i have read the title i
1 day 13 hours ago
- Belanja Online Cari Voucher Diskon
1 day 13 hours ago
- The kernel doesn't really
2 days 1 hour ago