ssh – host hopping (with Jump host)

2018-08-20 1 min read Linux

Most of the times I need to jump hosts with ssh. What do I mean by that. Let me try to explain :

Host Hopping

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 .ssh/config file but for that I need to have some program like nc installed on all the hosts in between which might not be practical in all cases. So, here is something that I found very useful.

Continue reading

ss – utility to investigate sockets.

2011-09-07 1 min read Fedora Linux

Sometimes, you find some interesting application/command by accident, and that is just what happened a few days back. Well, I was doing a ssh and as usual made my share of mistake in typing and missed the “h” from the ssh command and saw a list of options instead of my prompt on remote server.

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

Continue reading

[Solved] ssh works but scp does not

2011-08-29 1 min read Bash Fedora Linux

Structure of an SSH binary packet
Image via Wikipedia

For quite sometime now, I was having this issue, that for the home system, I was able to connect to is using ssh 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.

Continue reading

Try all colors in xterm with script before setting the color

2011-03-18 2 min read Bash Fedora Learning Linux

If you are looking for testing the colors on how they would look like in the xterm before you set the color then here is a small script for you.

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> #          FILE:  xterm_colors-test.sh<br /> #<br /> #         USAGE:  ./xterm_colors-test.sh<br /> #<br /> #   DESCRIPTION:  Test all the colors for xterm bg<br /> #<br /> #       OPTIONS:  ---<br /> #  REQUIREMENTS:  ---<br /> #          BUGS:  ---<br /> #         NOTES:  ---<br /> #        AUTHOR:   Amit Agarwal (amit.agarwal@amit-agarwal.co.in), aka<br /> #       COMPANY:  Individual<br /> #       VERSION:  1.0<br /> #       CREATED:  02/18/2011 01:02:51 PM IST<br /> #      REVISION:  1.0<br /> #===============================================================================<br /> <br /> cat /usr/share/X11/rgb.txt |sed 's/\([0-9]\{1,3\}[ \t]*\)\{3\}//'|sed 's/^ *//' >~/rgb.txt<br /> while read line<br /> do<br /> bg=$(echo $line)<br /> echo $line<br /> echo "Trying $bg color"<br /> xterm -bg "$bg"&<br /> sleep 5<br /> kill -9 $!<br /> done < ~/rgb.txt
    </div>
  </td>
</tr>
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
28
29
30

This can be used in various ways but I will leave the choice to you. One option that I should probably still tell is :

Continue reading