Changes between Initial Version and Version 1 of MonsoonSshAgent

17/01/13 09:12:45 (8 years ago)


  • MonsoonSshAgent

    v1 v1  
     2= SSH Setup on MONSooN =         
     4In order to submit UM jobs to MONSooN from the UMUI on PUMA you need to have set up ssh-agent and ssh-forwarding correctly. 
     6This page attempts to describe what you need to do to setup ssh-agent. Since instructions will differ depending on your current setup; whether you already have an ssh-agent running on PUMA and if so, where it is initiated from, be that PUMA or forwarded from a localhost, we cannot cover all scenarios and offer this information as advice only. 
     9== Determining if you already have an ssh-agent running on PUMA == 
     11First we need to determine if you already have an ssh-agent running on PUMA. Login to PUMA and run the command `ssh-add -l` 
     13=== Scenario A: === 
     15puma$ ssh-add -l 
     161024 7e:c9:c1:a6:f5:71:e3:bd:d9:84:23:4c:e4:fc:f7:ea /home/ros/.ssh/id_dsa (DSA) 
     18If the result is similar to the above then you already have an ssh-agent running on PUMA. Please go to the setup instructions entitled "Setting up your public key PUMA". 
     20=== Scenario B: === 
     22puma$ ssh-add -l 
     23Could not open a connection to your authentication agent. 
     25Output similar to the above indicates that you do not have an ssh-agent running on PUMA. Please follow the instructions entitled "Setting up ssh-agent on PUMA". 
     27== Setting up ssh-agent on PUMA == 
     29Note: The following instructions assume that you haven't already got ssh-agent setup on PUMA. 
     31 1. Generate the authentication key on PUMA: 
     33    puma$ ssh-keygen -f ~/.ssh/id_dsa -C "‹userid›" 
     34    Generating public/private rsa key pair. 
     35    Enter passphrase(empty for no passphrase): [TYPE_YOUR_PASSPHRASE] 
     36    Enter same passphrase again: [TYPE_YOUR_PASSPHRASE] 
     37    Your identification has been saved in ~/.ssh/id_dsa. 
     38    Your public key has been saved in ~/.ssh/ 
     39    The key fingerprint is: 
     40    md5 1024 [String of characters] ‹userid› 
     42    [TYPE-YOUR-PASSPHRASE] is a fairly complicated and unguessable passphrase. You can use spaces in the pass phrase if it helps you to remember it more readily. It is recommended that you don't use your password just in case this is hacked. 
     44 2. Add the public key to the ~/.ssh/authorized_keys file on PUMA: 
     46    puma$ cat ~/.ssh/ >> ~/.ssh/authorized_keys 
     49 3. Run ssh-agent on PUMA: 
     51 Make the ssh-agent automatically start-up when your session runs. 
     53 Copy my setup script to `$HOME/.ssh/setup`, and ensure it has execute permission: 
     55    puma$ chmod u+x $HOME/.ssh/setup 
     57 Call this script from your `.kshrc` (if you don't have a `.kshrc` file call it from your `.profile`) by adding the following line: 
     59    . $HOME/.ssh/setup 
     62 4. Run the following command and type your passphrase (you may need to do this every time a new ssh-agent is started - ie. every time you re-start your local session): 
     64    puma$ ssh-add 
     65    Enter passphrase for ~/.ssh/id_dsa (‹userid› [Type Passphrase] 
     68 5. Now complete the section entitled "Setting up ssh-forwarding" 
     71== Setting up your public key == 
     73The following instructions assume that you already have an ssh-agent running on PUMA 
     75The purpose of this section is to set up your public keys so that you don't need to supply your PUMA password during the job submission process. You need to copy your public key to the `~/.ssh/authorized_keys` file on PUMA, but which key this is, depends on how you setup the ssh-agent. 
     77Is the agent running on PUMA or has it been forwarded from a localhost (ie. the machine you logged into PUMA from)? 
     79The easiest way to determine this is to search the processes you have running on PUMA, by issuing the command: 
     81ps -flu | grep ssh-agent 
     84If the search is successful, then you are running the agent on PUMA and you need to run the following command to add your PUMA public key to the `~/.ssh/authorized_keys` file on PUMA: 
     86puma$ cat ~/.ssh/ >> ~/.ssh/authorized_keys 
     89Otherwise the ssh-agent is being forwarded from another machine. You now need to determine which machine that is, most likely to be the one you logged into PUMA from and copy the public key from that machine to the `~/.ssh/authorized_keys` file on PUMA. This can be achieved in a secure manner by running the following command: 
     91puma$ cat ~/.ssh/ | ssh ‹userid› 'mkdir -p .ssh ; cat - >> ~/.ssh/authorized_keys' 
     94Note: Depending on the type of public key you have previously generated, you may find it is in a file called `~/.ssh/` rather than `` 
     96Now complete the section entitled "Setting up ssh-forwarding". 
     98== Setting up ssh-forwarding == 
     100'''On PUMA:''' 
     102If you already have the file `$HOME/.ssh/config` add the following lines to it, otherwise first create the file `$HOME/.ssh/config` and add the following lines. 
     104Host monsoon 
     105ForwardAgent yes 
     107Host * 
     108ForwardAgent no 
     109ForwardX11 yes 
     110ForwardX11Trusted yes 
     114('''Note:''' This is on the lander '''NOT''' the IBM) 
     116Create, or append to, the file `$HOME/.ssh/config` the following lines. 
     118Host *.* 
     119ForwardAgent no 
     121Host * 
     122ForwardAgent yes 
     123ForwardX11 yes 
     126If all has worked correctly, you should only be required to enter your MONSooN passcode once for each job you submit.