Continued from page 1
Now we'll telnet into Cash and concatenate
sue.pub file into /home/named/.ssh/authorized_keys file.
Cash$> pwd /home/named/.ssh Cash$> cat sue.pub >> authorized_keys Cash$> exit Connection closed. Johnny$>
Let's recap what we've done so far. 1) We've created public and private keys on Johnny. 2) We've ftp'd
public key file, sue.pub, from Johnny to Cash. 3) We've telnetted to Cash, and concatenated
contents of sue.pub into authorized_keys
We're now ready to manually login from Johnny to Cash using ssh.
Johnny$> ssh -i /home/boy/.ssh/sue named@Cash The authenticity of host 'Cash (xxx.yyy.zzz.aaa)' can't be established. RSA key fingerprint is 65:11:7d:ef:ed:a3:cc:34:d1:b5:ba:c9:16:22:31:23. Are you sure you want to continue connecting (yes/no)? yes ================================================================
*** NOTICE TO ALL USERS ***
================================================================ Cash$>exit Connection to Cash closed. Johnny$>
Now on Johnny, create a shell script called 'boynamedsue.sh' with
following one line of contents and chmod
script to 777.
ssh -i /home/boy/.ssh/sue named@Cash /usr/bin/ls -l
Next, execute
script on Johnny.
Johnny$> boynamedsue.sh ================================================================
*** NOTICE TO ALL USERS ***
================================================================ -rwxrwxr-x 1 named namedgrp 10020 Oct 17 14:35 namedfile1.txt -rw-r--r-- 1 named namedgrp 680 Aug 14 16:18 namedfile.html -rw------- 1 named namedgrp 1148 Aug 18 09:51 mbox drwxr-xr-x 2 named namedgrp 512 Jun 17 13:38 old Johnny$>
You just executed a program on Johnny, that logged into Cash and ran a program (unix 'ls -l').
The next step you'll want to take is to replace
'/usr/bin/ls -l' command in
boynamedsue.sh program with
path and name of
program that you want to run.

C.S. Deam is the "mind behind" ToothyGrin.com, ComputerNuggets.com, DishAddict.com, and Online-Auction-Description-Blaster.com. Visit his sites and see what kind of goodies he's giving away this week.