Skip to Content
Linux Administration Cookbook
book

Linux Administration Cookbook

by Adam K. Dean
December 2018
Beginner
826 pages
22h 54m
English
Packt Publishing
Content preview from Linux Administration Cookbook

How it works...

When you add the -D option to SSH, or add the DynamicForward option to your SSH config file, you're telling SSH that you want to specify a port on your local side that will forward any requests received to it over your SSH connection.

Let's break down our commands:

[vagrant@centos1 ~]$ ssh -f -D9999 192.168.33.11 sleep 120

First, as we did previously, we've used -f and sleep to keep a connection open, while dropping us back to the centos1 prompt once a connection is established:

-f ... sleep 120

We've also specified our -D option, with a randomly chosen port:

-D9999
I use 9999 through force of habit, but occasionally I mix it up a bit by using 7777, or even 6666 if I'm feeling really wild. You may use whichever port you wish ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781789342529Supplemental Content