Terminating a SSH session after starting background process.

2011-05-14 3 min read Learning Linux

 

This is too good. If you are planning to start a background process in the bash script in the background and continue in the script, you cannot do it until…….

You would need to close the stdout/stdin and stderr before you can terminate any ssh session automatically. Here’s some more light on this topic.

http://lists.debian.org/debian-user/2005/09/msg00254.html

On Thu, Sep 01, 2005 at 05:33:28PM -0400, Roberto C. Sanchez wrote: > I occasionally log into a machine remotely and start a process in the > background: > > command & > > However, when I log out of the machine, the ssh process on my local > machine blocks. I guess that it is becuase the remote still has jobs > running. Is there a way to get it start the process in the background > and then detach from the shell? I have already tried this:

Continue reading

Easy ssh configuration with .ssh/config file

2011-04-11 1 min read Bash Learning Linux

If you ssh to many hosts then you are aware of the pain that it takes to ssh with different username and hostname. There is an alias that you can creat with native ssh though. Here I will show you the same with an example.

  <td>
    <div class="text codecolorer">
      cat <<EOF >>~/.ssh/config<br /> Host <alias><br /> Username <user name><br /> Port <port number><br /> Hostname <hostname>
    </div>
  </td>
</tr>
1
2
3
4
5

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.

Continue reading

PuTTY alternatives - AlternativeTo.net

2010-07-27 1 min read Uncategorized

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:
<a href="http://alternativeto.net/desktop/putty/">http://alternativeto.net/desktop/putty/<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/06/05/putty-ssh-without-password/">PuTTY ssh without password (amit-agarwal.co.in) <li class="zemanta-article-ul-li"><a href="http://www.downloadsquad.com/2010/05/18/kitty-is-win32-native-putty/?zemanta-tracking">KiTTY is Win32-native PuTTY (downloadsquad.com) <li class="zemanta-article-ul-li"><a href="http://lifehacker.com/5541871/kitty-adds-session-saving-portability-and-more-to-putty">KiTTY Adds Session Saving, Portability, and More to PuTTY [Downloads] (lifehacker.com) <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/04/11/putty-export-client-display-on-login-for-opening-x-application-and-terminal/">PuTTY export client display on login for opening X application and terminal. (amit-agarwal.co.in) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e3.png" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">

Continue reading

PuTTY ssh without password

2010-06-05 1 min read Linux

you can do a ssh without password.. Today we will see how to do this with putty.

Generate public/private (DSA)key pair using puttygen.
copy the public key to ~/.ssh/authourized_keys on your server (moonware/sunware/skyware). Same key can be used on all the servers.
make sure that your home directory permissions are 755
directory permission for .ssh is 700
file permission for authourized_keys is 600
now login using putty and specify your private key in the configuration of putty and also specify your username.

Continue reading

mussh - Multihost SSH wrapper

2010-05-25 1 min read Bash Fedora Linux

Description:

Mussh is a <a class="zem_slink freebase/en/shell_script" title="Shell script" rel="wikipedia" href="http://en.wikipedia.org/wiki/Shell_script">shell script that allows you to execute a command or script over ssh on multiple hosts with one command. When possible mussh will use <a class="zem_slink freebase/en/ssh-agent" title="Ssh-agent" rel="wikipedia" href="http://en.wikipedia.org/wiki/Ssh-agent">ssh-agent and RSA/DSA keys to minimize the need to enter your password more than once.

It is a utility for <a class="zem_slink freebase/en/system_administrator" title="System administrator" rel="wikipedia" href="http://en.wikipedia.org/wiki/System_administrator">system administrators maintaining more than one hosts. The utility will help the admin to execute the same command on multiple hosts with a single command.

Continue reading

Menu driven ssh.

2010-05-24 1 min read Bash

I have quite a lot of servers where I need to ssh at workplace and I generally don&#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.

echo &#8221;Enter the server name:&#8221;
echo &#8221;1. redhat&#8221;
echo &#8221;2. fedora&#8221;

read server

if [ &#8221;$server&#8221; = &#8221;1&#8221; ]; then
ssh amit@redhat
else if [ &#8221;$server&#8221; = &#8221;2&#8221; ]; then
ssh amit@fedora
else
echo &#8221;Not a valid choice&#8221;
fi
fi

Continue reading
Newer posts