<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SSH on Amit Agarwal Linux Blog</title>
    <link>/tags/ssh/</link>
    <description>Recent content in SSH on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 06 Mar 2022 00:00:00 +0530</lastBuildDate>
    
	<atom:link href="/tags/ssh/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>mussh-run-commands-on-multiple-hosts</title>
      <link>/2022/03/06/mussh-run-commands-on-multiple-hosts/</link>
      <pubDate>Sun, 06 Mar 2022 00:00:00 +0530</pubDate>
      
      <guid>/2022/03/06/mussh-run-commands-on-multiple-hosts/</guid>
      <description>&lt;p&gt;&lt;strong&gt;mussh&lt;/strong&gt; allows you to run command/commands on multiple hosts
at the same time. If you have farm of server setup with passwordless
ssh or with same password (which is generally the case), then using
mussh you can either check all the servers for some output or fix
something or maybe update all the packages. How cool is that :)&lt;/p&gt;
&lt;p&gt;Here is description of this package from &lt;em&gt;dnf&lt;/em&gt; repo&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Name         : mussh
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Version      : 1.0
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Release      : 18.fc35
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Architecture : noarch
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Size         : 20 k
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Source       : mussh-1.0-18.fc35.src.rpm
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Repository   : fedora
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Summary      : Multihost SSH wrapper
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;URL          : http://www.sourceforge.net/projects/mussh
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;License      : GPL+
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Description  : Mussh is a shell script that allows you to execute a command or
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : script over ssh on multiple hosts with one command. When possible
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : mussh will use ssh-agent and RSA/DSA keys to minimize the need to
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;             : enter your password more than once.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
    </item>
    
    <item>
      <title>ssh trick – ssh to remote host with bastion host</title>
      <link>/2019/09/16/ssh-trick-ssh-to-remote-host-with-bastion-host/</link>
      <pubDate>Mon, 16 Sep 2019 00:55:20 +0000</pubDate>
      
      <guid>/2019/09/16/ssh-trick-ssh-to-remote-host-with-bastion-host/</guid>
      <description>&lt;p&gt;Lot of times, you have to ssh to a server with bastion host. If you dont know what is bastion host then see this:&lt;/p&gt;
&lt;img class=&#34;alignnone size-medium wp-image-14322&#34; src=&#34;https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?resize=300%2C184&#34; alt=&#34;bastion host&#34; width=&#34;300&#34; height=&#34;184&#34; srcset=&#34;https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?resize=300%2C184 300w, https://i2.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2019/09/bastion.png?w=620 620w&#34; sizes=&#34;(max-width: 300px) 100vw, 300px&#34; data-recalc-dims=&#34;1&#34; /&gt; 
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Now, in such cases, either you add an entry in “~/.ssh/config” to route the ssh through the bastion host or do ssh to bastion host and then ssh from there to the actual host. But wait, there is always a better way:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ssh – host hopping (with Jump host)</title>
      <link>/2018/08/20/ssh-host-hopping-with-jump-host/</link>
      <pubDate>Mon, 20 Aug 2018 01:00:07 +0000</pubDate>
      
      <guid>/2018/08/20/ssh-host-hopping-with-jump-host/</guid>
      <description>&lt;p&gt;Most of the times I need to jump hosts with ssh. What do I mean by that. Let me try to explain :&lt;figure class=&#34;wp-block-image&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img class=&#34;wp-image-14226&#34; src=&#34;https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2018/08/host-hopping.jpg?w=688&#34; alt=&#34;&#34; srcset=&#34;https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2018/08/host-hopping.jpg?w=1152 1152w, https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2018/08/host-hopping.jpg?resize=300%2C169 300w, https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2018/08/host-hopping.jpg?resize=768%2C432 768w, https://i0.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/2018/08/host-hopping.jpg?resize=1024%2C576 1024w&#34; sizes=&#34;(max-width: 688px) 100vw, 688px&#34; data-recalc-dims=&#34;1&#34; /&gt; &lt;figcaption&gt;Host Hopping&lt;/figcaption&gt; &lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;If I need to got to host h3 then I need to first login to h1 and from there to host h2 and finally to host h3. This can be done with &lt;strong&gt;.ssh/config&lt;/strong&gt; file but for that I need to have some program like &lt;strong&gt;nc&lt;/strong&gt; installed on all the hosts in between which might not be practical in all cases. So, here is something that I found very useful.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Send history of current host to some other host over ssh</title>
      <link>/2018/02/26/send-history-current-host-host-ssh/</link>
      <pubDate>Mon, 26 Feb 2018 00:44:11 +0000</pubDate>
      
      <guid>/2018/02/26/send-history-current-host-host-ssh/</guid>
      <description>&lt;p&gt;Sometimes I want to save the history of current host on another host. This is to ensure that I can use copy/paste on other host to run the commands. To this, I found a simple solution –&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;history| ssh &amp;lt;user&amp;gt;@&amp;lt;host&amp;gt; &#39;cat - &amp;gt; /tmp/history&#39;&lt;/pre&gt;
&lt;p&gt;And on the new host, you can find the history in file “/tmp/history”, cool :). Now I can quick edit this file to create this as shell script as well if required. How cool is that.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ssh – remove offending key.</title>
      <link>/2016/04/04/ssh-remove-offending-key/</link>
      <pubDate>Mon, 04 Apr 2016 01:05:25 +0000</pubDate>
      
      <guid>/2016/04/04/ssh-remove-offending-key/</guid>
      <description>&lt;p&gt;Whenever a system/server is re-installed or the host key changed for any reason, you would have seen the “host key verification failed”. And as usual you would have to go to known_hosts file and delete the offending key. I will show you 2 simple ways to do this here.&lt;/p&gt;
&lt;p&gt;The output that you get in such scenario is:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Offending ECDSA key in ~/.ssh/known_hosts:4&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;First, you can use sed to directly delete the offending key with a command like this :&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Executing commands on multiple hosts</title>
      <link>/2015/09/21/executing-commands-multiple-hosts/</link>
      <pubDate>Mon, 21 Sep 2015 00:33:38 +0000</pubDate>
      
      <guid>/2015/09/21/executing-commands-multiple-hosts/</guid>
      <description>&lt;p&gt;If you have to execute the same command in multiple hosts, then you can use mussh:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl&gt;
&lt;dt&gt;Description : Mussh is a &lt;a class=&#34;zem_slink&#34; title=&#34;Shell script&#34; href=&#34;http://en.wikipedia.org/wiki/Shell_script&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;shell script&lt;/a&gt; that allows you to execute a command or script&lt;/dt&gt;
&lt;dd&gt;over ssh on multiple hosts with one command. When possible mussh will use&lt;/dd&gt;
&lt;dd&gt;ssh-agent and RSA/DSA keys to minimize the need to enter your password&lt;/dd&gt;
&lt;dd&gt;more than once.&lt;/dd&gt;
&lt;/dl&gt;&lt;/blockquote&gt;
&lt;p&gt;First install mussh with the following command&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;dnf install mussh&lt;/pre&gt;
&lt;p&gt;Now to run this for multiple hosts, you can run like this&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ssh authorized keys – limit ssh session to custom command</title>
      <link>/2015/03/04/ssh-authorized-keys-limit-ssh-session-custom-command/</link>
      <pubDate>Wed, 04 Mar 2015 00:34:21 +0000</pubDate>
      
      <guid>/2015/03/04/ssh-authorized-keys-limit-ssh-session-custom-command/</guid>
      <description>&lt;p&gt;If you want a ssh key to be able to run a custom command only and nothing beyond that, then you can use the “command” option in the authorized_keys file of ssh.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;For example, to limit user to run only top command with a key, you can add the key like this:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;echo &#39;command=&#34;/usr/bin/top&#34; ssh-rsa &#39; &amp;gt;&amp;gt;~/.ssh/authorized_keys&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Multiple entry in .ssh/config file</title>
      <link>/2014/10/24/multiple-entry-sshconfig-file/</link>
      <pubDate>Fri, 24 Oct 2014 00:24:29 +0000</pubDate>
      
      <guid>/2014/10/24/multiple-entry-sshconfig-file/</guid>
      <description>&lt;p&gt;Here is a &lt;a title=&#34;Easy ssh configuration with .ssh/config file&#34; href=&#34;http://blog.amit-agarwal.co.in/2011/04/11/easy-ssh-configuration-with-sshconfig-file/&#34; target=&#34;_blank&#34;&gt;link to one post on ssh config&lt;/a&gt; file.&lt;/p&gt;
&lt;p&gt;However, if you want entries for lot of servers with their IPs or names, then it could be cumbersome to add all the entries in the .ssh/config file. So, here is a shortcut notation:&lt;/p&gt;
&lt;pre class=&#34;brush:plain&#34;&gt;Host 1 2 3 4 5 6
Hostname 192.168.1.%h
    User 
    
    Ciphers arcfour

where &#39;%h&#39; denotes the IP that you use in the ssh command.

The following escape character substitutions will be performed:
             ‘%d’ (local user&#39;s home directory), ‘%h’ (remote host name), ‘%l’ (local host name),
              ‘%n’ (host name as provided on the command line), ‘%p’ (remote port),
              ‘%r’ (remote user name) or ‘%u’ (local user name).

&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>Debuggging bash cron scripts.</title>
      <link>/2014/09/01/debuggging-bash-cron-scripts/</link>
      <pubDate>Mon, 01 Sep 2014 00:44:36 +0000</pubDate>
      
      <guid>/2014/09/01/debuggging-bash-cron-scripts/</guid>
      <description>&lt;p&gt;I have to several times debug scripts that I get complain about working when logging in normally but they do not work when run in cron mode. So, quite a lot of times, redirecting the stderr of the script is all that is required to see what is happening, but sometimes that just does not help if the script is calling another script which is mis-behaving and under lot of other conditions. So, how to at-least take a look at why these are failing, login with ssh.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>slow ssh connection</title>
      <link>/2013/02/26/slow-ssh-connection/</link>
      <pubDate>Tue, 26 Feb 2013 00:35:55 +0000</pubDate>
      
      <guid>/2013/02/26/slow-ssh-connection/</guid>
      <description>&lt;p&gt;If you are experiencing slow ssh connections, then possibly your system is trying to do reverse lookup of the &lt;a class=&#34;zem_slink&#34; title=&#34;IP address&#34; href=&#34;http://en.wikipedia.org/wiki/IP_address&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;IP address&lt;/a&gt;. If that is the case, then you can add the below to “hosts” line in &lt;strong&gt;/etc/nsswitch.conf&lt;/strong&gt; file.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;‘[NOTFOUND=return]’&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The other cause for slow connections can be &lt;strong&gt;&lt;a class=&#34;zem_slink&#34; title=&#34;Generic Security Services Application Program Interface&#34; href=&#34;http://en.wikipedia.org/wiki/Generic_Security_Services_Application_Program_Interface&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;GSSAPI&lt;/a&gt;&lt;/strong&gt; authentication. If that is the case, then the simplest solution is to add the following in your “&lt;strong&gt;~/.ssh/config&lt;/strong&gt;” file:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ssh reverse tunning..</title>
      <link>/2013/02/14/ssh-reverse-tunning/</link>
      <pubDate>Thu, 14 Feb 2013 00:41:21 +0000</pubDate>
      
      <guid>/2013/02/14/ssh-reverse-tunning/</guid>
      <description>&lt;p&gt;If you want to access some local resources like the release website from the &lt;a class=&#34;zem_slink&#34; title=&#34;Server (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Server_%28computing%29&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;remote server&lt;/a&gt; when you are connecting to the remoter server using &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt; over &lt;a class=&#34;zem_slink&#34; title=&#34;Virtual private network&#34; href=&#34;http://en.wikipedia.org/wiki/Virtual_private_network&#34; target=&#34;_blank&#34; rel=&#34;wikipedia&#34;&gt;VPN&lt;/a&gt;, then possibly reverse ssh tunnelling is the best option. So, basically when you are connecting to the remote server, you tell the server your intent to do so and which local resource you want to connect to and on which port.So, here I want to connnet to google.com and tunnel the data to 192.168.131.921:9090 tthough the tunnel, then the command to use will be  ::&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Add ssh key to remote host</title>
      <link>/2011/11/15/add-ssh-key-remote-host/</link>
      <pubDate>Tue, 15 Nov 2011 08:00:01 +0000</pubDate>
      
      <guid>/2011/11/15/add-ssh-key-remote-host/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;https://i0.wp.com/commons.wikipedia.org/wiki/File:X11_ssh_tunnelling.png&#34;&gt;&lt;img class=&#34;zemanta-img-configured&#34; title=&#34;Example of tunnelling an X11 application over SSH&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//300px-X11_ssh_tunnelling.png?resize=300%2C199&#34; alt=&#34;Example of tunnelling an X11 application over SSH&#34; width=&#34;300&#34; height=&#34;199&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;If you are working on recent versions of the *nix &lt;a class=&#34;zem_slink&#34; title=&#34;Operating system&#34; href=&#34;http://en.wikipedia.org/wiki/Operating_system&#34; rel=&#34;wikipedia&#34;&gt;OS&lt;/a&gt; like &lt;a class=&#34;zem_slink&#34; title=&#34;Fedora (operating system)&#34; href=&#34;http://www.fedoraproject.org/&#34; rel=&#34;homepage&#34;&gt;Fedora&lt;/a&gt; or &lt;a class=&#34;zem_slink&#34; title=&#34;Ubuntu (operating system)&#34; href=&#34;http://www.ubuntu.com/&#34; rel=&#34;homepage&#34;&gt;Ubuntu&lt;/a&gt; then you would know about the commad &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt;-copy-id. But if you land up using one of the older versions like &lt;a class=&#34;zem_slink&#34; title=&#34;Solaris (operating system)&#34; href=&#34;http://oracle.com/solaris&#34; rel=&#34;homepage&#34;&gt;Solaris&lt;/a&gt; or something where the command is not present, then probably you need a simpler solution to this. One of the simplest solution is with a lot of assumtions, simply copy the id_rsa file to &lt;a class=&#34;zem_slink&#34; title=&#34;Server (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Server_%28computing%29&#34; rel=&#34;wikipedia&#34;&gt;remote server&lt;/a&gt; and hope it works. And here is  a script to do just that:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>ss – utility to investigate sockets.</title>
      <link>/2011/09/07/ss-utility-investigate-sockets/</link>
      <pubDate>Wed, 07 Sep 2011 06:27:46 +0000</pubDate>
      
      <guid>/2011/09/07/ss-utility-investigate-sockets/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Sometimes, you find some interesting application/command by accident, and that is just what happened a few days back. Well, I was doing a &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt; and as usual made my share of mistake in typing and missed the “h” from the ssh command and saw a list of &lt;a class=&#34;zem_slink&#34; title=&#34;Option (finance)&#34; href=&#34;http://en.wikipedia.org/wiki/Option_%28finance%29&#34; rel=&#34;wikipedia&#34;&gt;options&lt;/a&gt; instead of my prompt on &lt;a class=&#34;zem_slink&#34; title=&#34;Server (computing)&#34; href=&#34;http://en.wikipedia.org/wiki/Server_%28computing%29&#34; rel=&#34;wikipedia&#34;&gt;remote server&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, that set me thinking and fond that its a very interesting command that comes with iproute on Fedoara, so if you want this command, then install iproute like this&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>[Solved] ssh works but scp does not</title>
      <link>/2011/08/29/solved-ssh-works-scp/</link>
      <pubDate>Mon, 29 Aug 2011 00:48:04 +0000</pubDate>
      
      <guid>/2011/08/29/solved-ssh-works-scp/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 300px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Ssh_binary_packet_alt.svg&#34;&gt;&lt;img title=&#34;Structure of an SSH binary packet&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//300px-Ssh_binary_packet_alt.svg_1.png?resize=300%2C232&#34; alt=&#34;Structure of an SSH binary packet&#34; width=&#34;300&#34; height=&#34;232&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;For quite sometime now, I was having this issue, that for the home system, I was able to connect to is using &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34; rel=&#34;wikipedia&#34;&gt;ssh&lt;/a&gt; but it never worked. Fnally after quite some debugging finally I found that the issue was with thebashrc. So, everytime I had to do a scp I would have to move/rename bashrc and do the reverse action after the scp was done.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Terminating a SSH session after starting background process.</title>
      <link>/2011/05/14/terminating-ssh-session-starting-background-process/</link>
      <pubDate>Sat, 14 May 2011 16:59:43 +0000</pubDate>
      
      <guid>/2011/05/14/terminating-ssh-session-starting-background-process/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This is too good. If you are planning to start a background &lt;a class=&#34;zem_slink&#34; title=&#34;Process (computing)&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Process_%28computing%29&#34;&gt;process&lt;/a&gt; in the &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash script&lt;/a&gt; in the background and continue in the script, you cannot do it until…….&lt;/p&gt;
&lt;p&gt;You would need to close the stdout/stdin and &lt;a class=&#34;zem_slink&#34; title=&#34;Standard streams&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Standard_streams&#34;&gt;stderr&lt;/a&gt; before you can terminate any ssh session automatically. Here’s some more light on this topic.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;http://lists.debian.org/debian-user/2005/09/msg00254.html&#34;&gt;http://lists.debian.org/debian-user/2005/09/msg00254.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On Thu, Sep 01, 2005 at 05:33:28PM -0400, Roberto C. Sanchez wrote: &amp;gt; I occasionally log into a &lt;a class=&#34;zem_slink&#34; title=&#34;Machine&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Machine&#34;&gt;machine&lt;/a&gt; remotely and start a process in the &amp;gt; background: &amp;gt; &amp;gt; command &amp;amp; &amp;gt; &amp;gt; However, when I log out of the machine, the ssh process on my local &amp;gt; machine blocks. I guess that it is becuase the remote still has jobs &amp;gt; running. Is there a way to get it start the process in the background &amp;gt; and then detach from the shell? I have already tried this:&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Easy ssh configuration with .ssh/config file</title>
      <link>/2011/04/11/easy-ssh-configuration-with-sshconfig-file/</link>
      <pubDate>Mon, 11 Apr 2011 06:30:00 +0000</pubDate>
      
      <guid>/2011/04/11/easy-ssh-configuration-with-sshconfig-file/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;If you &lt;a class=&#34;zem_slink&#34; title=&#34;Secure Shell&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Secure_Shell&#34;&gt;ssh&lt;/a&gt; to many hosts then you are aware of the pain that it takes to ssh with different username and &lt;a class=&#34;zem_slink&#34; title=&#34;Hostname&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Hostname&#34;&gt;hostname&lt;/a&gt;. There is an alias that you can creat with native ssh though. Here I will show you the same with an example.&lt;/p&gt;
&lt;div class=&#34;codecolorer-container text solarized-light&#34; style=&#34;overflow:auto;white-space:nowrap;width:550px;&#34;&gt;
  &lt;table cellspacing=&#34;0&#34; cellpadding=&#34;0&#34;&gt;
    &lt;tr&gt;
      &lt;td class=&#34;line-numbers&#34;&gt;
        &lt;div&gt;
          1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;
        &lt;/div&gt;
      &lt;/td&gt;
&lt;pre&gt;&lt;code&gt;  &amp;lt;td&amp;gt;
    &amp;lt;div class=&amp;quot;text codecolorer&amp;quot;&amp;gt;
      cat &amp;lt;&amp;lt;EOF &amp;gt;&amp;gt;~/.ssh/config&amp;lt;br /&amp;gt; Host &amp;lt;alias&amp;gt;&amp;lt;br /&amp;gt; Username &amp;lt;user name&amp;gt;&amp;lt;br /&amp;gt; Port &amp;lt;port number&amp;gt;&amp;lt;br /&amp;gt; Hostname &amp;lt;hostname&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;You can optionally omit the parameters that you do not require explicitly. For example, if your port number is default then you can simply ignore the parameter.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PuTTY alternatives - AlternativeTo.net</title>
      <link>/2010/07/27/putty-alternatives-alternativeto-net-2/</link>
      <pubDate>Tue, 27 Jul 2010 04:09:35 +0000</pubDate>
      
      <guid>/2010/07/27/putty-alternatives-alternativeto-net-2/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I like PuTTY quite a bit but do not like the fact that it does not have any tab feature. So, if I am working on multiple machines then un-necessarily I will have too many windows open cluttering my desktop. So, here is the result of my quest to find the alternative:&lt;br&gt;
&amp;lt;a href=&amp;quot;http://alternativeto.net/desktop/putty/&amp;quot;&amp;gt;http://alternativeto.net/desktop/putty/&lt;/a&gt;&amp;lt;h6 class=&amp;quot;zemanta-related-title&amp;quot; style=&amp;quot;font-size: 1em;&amp;quot;&amp;gt;Related articles by Zemanta&lt;/h6&gt; &amp;lt;ul class=&amp;quot;zemanta-article-ul&amp;quot;&amp;gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/2010/06/05/putty-ssh-without-password/&amp;quot;&amp;gt;PuTTY ssh without password&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://www.downloadsquad.com/2010/05/18/kitty-is-win32-native-putty/?zemanta-tracking&amp;quot;&amp;gt;KiTTY is Win32-native PuTTY&lt;/a&gt; (downloadsquad.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://lifehacker.com/5541871/kitty-adds-session-saving-portability-and-more-to-putty&amp;quot;&amp;gt;KiTTY Adds Session Saving, Portability, and More to PuTTY [Downloads]&lt;/a&gt; (lifehacker.com)&lt;/li&gt; &amp;lt;li class=&amp;quot;zemanta-article-ul-li&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://blog.amit-agarwal.co.in/2010/04/11/putty-export-client-display-on-login-for-opening-x-application-and-terminal/&amp;quot;&amp;gt;PuTTY export client display on login for opening X application and terminal.&lt;/a&gt; (amit-agarwal.co.in)&lt;/li&gt; &lt;/ul&gt; &amp;lt;div class=&amp;quot;zemanta-pixie&amp;quot; style=&amp;quot;margin-top: 10px; height: 15px;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;zemanta-pixie-a&amp;quot; title=&amp;quot;Enhanced by Zemanta&amp;quot; href=&amp;quot;http://www.zemanta.com/&amp;quot;&amp;gt;&amp;lt;img class=&amp;quot;zemanta-pixie-img&amp;quot; style=&amp;quot;border: medium none; float: right;&amp;quot; src=&amp;quot;http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e3.png&amp;quot; alt=&amp;quot;Enhanced by Zemanta&amp;quot; /&amp;gt;&lt;/a&gt;&amp;lt;span class=&amp;quot;zem-script more-related pretty-attribution&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>PuTTY ssh without password</title>
      <link>/2010/06/05/putty-ssh-without-password/</link>
      <pubDate>Sat, 05 Jun 2010 02:08:36 +0000</pubDate>
      
      <guid>/2010/06/05/putty-ssh-without-password/</guid>
      <description>&lt;p&gt;&lt;tt&gt;you can do a ssh without password.. Today we will see how to do this with putty.&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;Generate public/private (DSA)key pair using puttygen.&lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;copy the public key to ~/.ssh/authourized_keys on your server (moonware/sunware/skyware). Same key can be used on all the servers.&lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;make sure that your home directory permissions are 755 &lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;directory permission for .ssh is 700&lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;file permission for authourized_keys is 600&lt;/tt&gt;&lt;br&gt;
&lt;tt&gt;now login using putty and specify your private key in the configuration of putty and also specify your username.&lt;/tt&gt;&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>mussh - Multihost SSH wrapper</title>
      <link>/2010/05/25/mussh/</link>
      <pubDate>Tue, 25 May 2010 11:33:59 +0000</pubDate>
      
      <guid>/2010/05/25/mussh/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Description:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Mussh is a &amp;lt;a class=&amp;quot;zem_slink freebase/en/shell_script&amp;quot; title=&amp;quot;Shell script&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Shell_script&amp;quot;&amp;gt;shell script&lt;/a&gt; that allows you to execute a command or script over ssh on multiple hosts with one command. When possible mussh will use &amp;lt;a class=&amp;quot;zem_slink freebase/en/ssh-agent&amp;quot; title=&amp;quot;Ssh-agent&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/Ssh-agent&amp;quot;&amp;gt;ssh-agent&lt;/a&gt; and RSA/DSA keys to minimize the need to enter your password more than once.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It is a utility for &amp;lt;a class=&amp;quot;zem_slink freebase/en/system_administrator&amp;quot; title=&amp;quot;System administrator&amp;quot; rel=&amp;quot;wikipedia&amp;quot; href=&amp;quot;http://en.wikipedia.org/wiki/System_administrator&amp;quot;&amp;gt;system administrators&lt;/a&gt; maintaining more than one hosts. The utility will help the admin to execute the same command on multiple hosts with a single command.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Menu driven ssh.</title>
      <link>/2010/05/24/menu-driven-ssh/</link>
      <pubDate>Mon, 24 May 2010 16:25:41 +0000</pubDate>
      
      <guid>/2010/05/24/menu-driven-ssh/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;I have quite a lot of servers where I need to ssh at workplace and I generally don&amp;amp;#8217;t remember all of them, so I wrote a simple yet useful script. In all the servers I have already copied my key so I dont need a password to login. Without much ado, here is the script.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;echo &amp;amp;#8221;Enter the server name:&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;1. redhat&amp;amp;#8221;&lt;br&gt;
echo &amp;amp;#8221;2. fedora&amp;amp;#8221;&lt;/p&gt;
&lt;p&gt;read server&lt;/p&gt;
&lt;p&gt;if [ &amp;amp;#8221;$server&amp;amp;#8221; = &amp;amp;#8221;1&amp;amp;#8221; ]; then&lt;br&gt;
ssh amit@redhat&lt;br&gt;
else if [ &amp;amp;#8221;$server&amp;amp;#8221; = &amp;amp;#8221;2&amp;amp;#8221; ]; then&lt;br&gt;
ssh amit@fedora&lt;br&gt;
else&lt;br&gt;
echo &amp;amp;#8221;Not a valid choice&amp;amp;#8221;&lt;br&gt;
fi&lt;br&gt;
fi&lt;br&gt;
&lt;span&gt;&lt;/span&gt;&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
