Multiple entry in .ssh/config file

2014-10-24 1 min read Learning

Here is a link to one post on ssh config file.

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:

Host 1 2 3 4 5 6
Hostname 192.168.1.%h
    User 
    
    Ciphers arcfour

where '%h' denotes the IP that you use in the ssh command.

The following escape character substitutions will be performed:
             ‘%d’ (local user'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).

Debuggging bash cron scripts.

2014-09-01 1 min read Bash Learning

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.

Continue reading

slow ssh connection

2013-02-26 1 min read Linux

If you are experiencing slow ssh connections, then possibly your system is trying to do reverse lookup of the IP address. If that is the case, then you can add the below to “hosts” line in /etc/nsswitch.conf file.

‘[NOTFOUND=return]’

The other cause for slow connections can be GSSAPI authentication. If that is the case, then the simplest solution is to add the following in your “~/.ssh/config” file:

Continue reading

ssh reverse tunning..

2013-02-14 1 min read Fedora Learning Linux

If you want to access some local resources like the release website from the remote server when you are connecting to the remoter server using ssh over VPN, 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  ::

Continue reading

Add ssh key to remote host

2011-11-15 3 min read Bash Learning Linux Solaris

Example of tunnelling an X11 application over SSH
Image via Wikipedia

If you are working on recent versions of the *nix OS like Fedora or Ubuntu then you would know about the commad ssh-copy-id. But if you land up using one of the older versions like Solaris 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 remote server and hope it works. And here is  a script to do just that:

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
Older posts Newer posts