<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Sniptools &#187; SSH</title> <atom:link href="http://sniptools.com/tag/ssh/feed/" rel="self" type="application/rss+xml" /><link>http://sniptools.com</link> <description>Design &#38; Technology Observations</description> <lastBuildDate>Tue, 15 May 2012 09:23:41 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Save SSH password for use in &quot;Terminal&quot; (OSX or *Nix)</title><link>http://sniptools.com/mac-osx/save-ssh-password-in-terminal</link> <comments>http://sniptools.com/mac-osx/save-ssh-password-in-terminal#comments</comments> <pubDate>Sat, 19 Jul 2008 04:37:39 +0000</pubDate> <dc:creator>Shanx</dc:creator> <category><![CDATA[Mac OSX]]></category> <category><![CDATA[System Maintenance]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[OSX]]></category> <category><![CDATA[SecureCRT]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[Terminal]]></category> <category><![CDATA[Tips/Tricks]]></category> <category><![CDATA[Windows]]></category><guid
isPermaLink="false">http://sniptools.com/cms/?p=163</guid> <description><![CDATA[How to set up time-saving shortcuts for SSH in Mac OSX or Linux, a bit like SecureCRT on Windows. ]]></description> <content:encoded><![CDATA[<p>Anyone who runs hosted remote servers and has to log into remote terminals for regular use, it is vital to have shortcuts that allow for quick login. SSH2 is the recommended way.</p><p>On Windows, there is the fantastic SSH2 tool <a
href="http://www.vandyke.com/products/securecrt/">SecureCRT</a>. Or if you're cash crunched, a combination of Putty and Putty Connection Manager works for many.</p><p>On Mac OSX and Unix/Linux systems, one doesn't truly need an SSH client at all, because the "<a
href="http://www.osxterminal.com/">Terminal</a>" application is inbuilt. People talk of iTerm and such, but I have still to see a value add for such tools.</p><p>But one does miss the convenience of SecureCRT on OSX, because I have still to find a true SecureCRT alternative for the Mac platform. Something that allows me to make pre-determined connections so I can just click on them to connect (which tools like <a
href="http://www.grepsoft.net/jellyfissh.html">JellyfiSSH</a> do) and then logs me in directly without prompting for a password (which JellyfiSHH does not do).</p><p>So I have simply made aliases in my [code].profile[/code] file, which gets executed everytime you start your Terminal window (so it's a good place to put your shortcuts and any code you wish to execute when the terminal starts, such as paths).</p><ol><li>Start the Terminal.</li><li>Open the profile file for the current user (you).</li><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">pico .profile</pre></div></div><li>Enter a new line for our shortcut.</li><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">s</span>=<span style="color: #ff0000;">'ssh -2 -p 22 user@host.com'</span></pre></div></div></ol><p>Quick explanation for that command in step 3. The letter "s" is the shortcut I make for connecting to the sniptools.com server. Change it to what you wish. This will mean that when I start Terminal, all I need to do is type "s" and it connects me via SSH to the sniptools.com server. The "-p" switch is an important one because some of us with paranoid security settings might have a different port number than the default port 22 for secure SSH. The rest user/host stuff is self-explanatory. The "-2" is to force SSH2 connections instead of older vanilla SSH.</p><p>Now. Save the profile file and source it to try it out:</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">source</span> .profile</pre></div></div><p>Sourcing is only for this one time, for your current Terminal window, which had already executed the profile file *before* we added this alias. When you start a new Terminal session, these aliases et al will be automatically set for you.</p><p>Done. Now your profile has the alias for "s". From now when you type "s" in your Terminal, it will connect, but it will ask you for a password. To get rid of the nagging password, we need to create public authentication key for the domain. This, in fact is what SecureCRT does behind the scenes on Windows too.</p><p>Here are the steps to accomplish this. Run these <strong>one-time</strong> commands in order from the Terminal window.</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># generate pub and priv keys, leave the passphrase empty</span>
<span style="color: #666666; font-style: italic;"># (simply press ENTER when asked for it)</span>
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#copy the pub key to the remote computer</span>
<span style="color: #666666; font-style: italic;">#(change port number if different from the usual 22)</span>
<span style="color: #666666; font-style: italic;">#change &quot;user&quot; to your user name</span>
<span style="color: #666666; font-style: italic;">#change &quot;host&quot; to your domain name</span>
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-P</span> <span style="color: #000000;">22</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub user<span style="color: #000000; font-weight: bold;">@</span>host:~<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#log on to the remote computer</span>
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">22</span> user<span style="color: #000000; font-weight: bold;">@</span>host
&nbsp;
<span style="color: #666666; font-style: italic;">#create the .ssh directory in the root login directory, if it doesn't already exist</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> .ssh
&nbsp;
<span style="color: #666666; font-style: italic;">#append key to file</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> id_rsa.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
&nbsp;
<span style="color: #666666; font-style: italic;">#delete the public key file, no longer needed</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> id_rsa.pub
&nbsp;
<span style="color: #666666; font-style: italic;">#log off the remote server</span>
<span style="color: #7a0874; font-weight: bold;">exit</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#logon to the remote server, without password prompt</span>
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-2</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">22</span> user<span style="color: #000000; font-weight: bold;">@</span>host</pre></td></tr></table></div><p>That's it. This is a huge timesaver. Now all I need to do to login to the sniptools.com server is type one letter, "s" in the Terminal, and I'm on! Follow these instructions for each host you connect to on a regular basis and you'll love the convenience henceforth.</p> ]]></content:encoded> <wfw:commentRss>http://sniptools.com/mac-osx/save-ssh-password-in-terminal/feed/</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>Upgrade Zend Optimizer on Cpanel WHM</title><link>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm</link> <comments>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm#comments</comments> <pubDate>Sat, 12 May 2007 05:22:32 +0000</pubDate> <dc:creator>Shanx</dc:creator> <category><![CDATA[System Maintenance]]></category> <category><![CDATA[cpanel]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[Tips/Tricks]]></category> <category><![CDATA[Zend]]></category><guid
isPermaLink="false">http://sniptools.com/cms/?p=147</guid> <description><![CDATA[upgrade zend optimizer on cpanel
]]></description> <content:encoded><![CDATA[<p>Simple little trick to get to the latest version.</p><p>Most <a
href="http://www.cpanel.net/products/cPanelandWHM/linux/try_cp_whm.htm">Cpanel/WHM</a> servers come with <a
href="http://www.php.net">PHP</a> and <a
href="http://www.zend.com">Zend</a> installed. With the recent (and important) update of PHP 5.2.1, the <a
href="http://www.zend.com/products/zend_optimizer">Zend Optimizer</a> that is installed by default (version 3.0.1 as of this writing) breaks.</p><p>You might begin to see a message like this:</p><div
class="code">[26-Apr-2007 10:32:49] PHP Warning: Zend Optimizer does not support this version of PHP — please upgrade to the latest version of Zend Optimizer in Unknown on line</div><p>To fix this, simply login to your SSH as root and execute the following command to upgrade Zend Optimiser:</p><blockquote><p><code>/scripts/installzendopt <span
style="color: #ee0000;">3.2.8</span></code></p></blockquote><p>Note that if you skip the version number, Zend Optimizer 3.0.1 will be installed by default. The trick is to specify the version as above. This will also work in the future, so as long as you know the latest released version of Zend Optimizer, just replace the red text above with that number.</p> ]]></content:encoded> <wfw:commentRss>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Fix for Cpanel update that breaks mysqlhotcopy</title><link>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade</link> <comments>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade#comments</comments> <pubDate>Mon, 02 Apr 2007 11:10:00 +0000</pubDate> <dc:creator>Shanx</dc:creator> <category><![CDATA[Hosting]]></category> <category><![CDATA[Unix]]></category> <category><![CDATA[cpanel]]></category> <category><![CDATA[database]]></category> <category><![CDATA[Databases]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[SSH]]></category> <category><![CDATA[Tips/Tricks]]></category><guid
isPermaLink="false">http://sniptools.com/cms/?p=135</guid> <description><![CDATA[fix mysqlhotcopy broken by cpanel upgrade
]]></description> <content:encoded><![CDATA[<p>The recent upgrades of Cpanel have been a pain because they've broken mysqlhotcopy. Not kosher. Fortunately fixing this is pretty straightforward by simply downgrading the DBD module of Perl, on which mysqlhotcopy relies.</p><p><span
id="more-135"></span></p><h3>The recent upgrades of Cpanel have been a pain because they've broken <code>mysqlhotcopy</code>. Not kosher. Fortunately fixing this is pretty easy, by simply downgrading the DBD module of Perl, which <code>mysqlhotcopy</code> relies on.</h3><p>Usually the error is something like this:</p><div
class="code">Invalid db.table name 'DBNAME.USERNAME`.`campaign' at /usr/bin/mysqlhotcopy line 854.</div><p>To solve this, simply downgrade the DBD to version 4.001. Create a script anywhere on your root folder as, say, <code>dbd-downgrade.sh</code>:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> dbd.tar.gz  <span style="color: #ff0000;">&quot;http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.001.tar.gz&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-cd</span> dbd.tar.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xf -
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> dbd.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> DBD-mysql-<span style="color: #000000;">4.001</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div><p>Then of course <code>chmod</code> the file to executable (644) and run it:</p><div
class="code">./dbd-downgrade.sh</div><p>Then try your <code>mysqlhotcopy</code> command again. It should work. The only thing to consider is that if your Cpanel is setup to upgrade automatically, it may rebuild DBD. You may need to downgrade the DBD again, until this thing is fixed!</p><p>If after this update, you see the error for RELOAD privileges, like this…</p><pre>DBD::mysql::db do failed: Access denied; you need the RELOAD privilege for this operation at /usr/bin/mysqlhotcopy line 472.</pre><p>…then simply login to mysql as "root" user through the root SSH terminal, and execute the following command:</p><pre class="bash" >mysql&gt;  grant all privileges on *.* to root@localhost;
mysql&gt;  flush privileges;</pre><p>Done. That should do it. Let me know if it doesn't.</p><h3>A more long term fix</h3><p>MySQL bug list has a <a
href="http://bugs.mysql.com/bug.php?id=27303">couple of suggested fixes</a>. If you are comfortable with Perl, you can edit the code in <code>/usr/bin/mysqlhotcopy</code> and have it solved in a better way.</p> ]]></content:encoded> <wfw:commentRss>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 4/10 queries in 0.002 seconds using disk: basic
Object Caching 688/696 objects using disk: basic

Served from: sniptools.com @ 2012-05-21 19:22:58 -->
