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

On the command line

Run the following from centos1:

[vagrant@centos1 ~]$ ssh -f -L 9999:127.0.0.1:8888 192.168.33.11 sleep 120

You may be prompted for your password (depending on what you've done in terms of key setup) and then be dropped back to the centos1 prompt.

Our SSH connection will stay up for two minutes.

Now, we run a curl, checking that our forwarding is working:

[vagrant@centos1 ~]$ curl 127.0.0.1:9999<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><title>Directory listing for /</title><body><h2>Directory listing for /</h2><hr><ul><li><a href=".bash_history">.bash_history</a><li><a href=".bash_logout">.bash_logout</a><li><a href=".bash_profile">.bash_profile</a><li><a href=".bashrc">.bashrc</a><li><a href=".ssh/">.ssh/</a> ...
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