[ale] automating an ssh script?

Michael Hirsch mhirsch at nubridges.com
Fri Jul 26 08:59:07 EDT 2002


On Thu, 2002-07-25 at 19:11, ChangingLINKS.com wrote:
> Okay, it looks like I made _some_ major progress, but I still cannot do 
> anything without giving a passphrase.
> Thanks to Michael Hirsh (and others) for giving me some directions that I 
> could use to get some results. Here are the commands that I ran. Can someone 
> edit these so that I know what I did wrong?
> 
> rm -rf ~/.ssh   //to start .ssh from scratch
> ssh-keygen -t rsa1  //to generate type1 public and private keys
> cp ~/.ssh/identity ~/.ssh/authorized_keys  //to create a file for the remote 
> machine

Don't do this.  That is your secret key and should not be published.

> cp ~/.ssh/identity.pub ~/.ssh/authorized_keys2  //ditto

That should be cp ~/.ssh/identity.pub ~/.ssh/authorized_keys.  The
authorized_keys2 file is for type 2 keys and you explicitly made a type
1 key.

> ftp ~/.ssh/authorized_keys AND  ~/.ssh/authorized_keys2 to remote machine's 
> ~/.ssh //upload files
> ssh user at shell1.host.com //test .ssh to see if it works
> exit  //thinking I should exit to run next command locally
> eval `ssh-agent`
> ssh-add ~/.ssh/identity
> ssh user at shell1.host.com //testing to see if I connect passphraseLESS
> eval `ssh-agent` //failed to connect without passphrase, decided to run eval 
> on remote machine
> 
> FAILED TO CONNECT WITHOUT USING A PASSPHRASE.
> 
> I do not own the remote box. How can I "Ensure that RSA authentication is 
> enabled for both the server ("RSAAuthentication yes" in sshd_config on the 
> server"? Tried downloading the file from my server - permission denied. Ftp 
> client crashed second time.

When in doubt, run 'ssh -v remotehost' and, if necessary, include that
information in your post.

In this case you put the wrong key in the authorized_keys* files. 
Fixing that might solve the problem.  If not, then try generating a type
2 key as well, since that is the default nowadays.  If that fails, send
us the output of 'ssh -v remotehost' for us to look at.

--Michael

> 
> On Wednesday 24 July 2002 22:44, ChangingLINKS.com wrote:
> > Yo yo yo! <- New York Santa Claus
> >
> > I am trying to automate the script below. I want to click on a menu item on
> > my desktop and have all of these commands get executed sequentially.
> > Currently, I paste them in the terminal one by one and I have to enter a
> > password three times (where "PASSWORD" is below). Anyone know how to
> > automate this deal with the PASSWORDS entered. If it is to be one script, I
> > may have to exit (as show below) to do the scp. Anyone?
> >
> >
> > BACKING UP WEB SITE WITH MYSQL DATABASE
> >
> > ssh user at host.com
> > PASSWORD
> > mysqldump -h db1.host.com -u user -ppassword user>/home/user/dbbackup.txt
> > tar cfvz /home/user/backup.tgz /home/user --exclude backup.tgz
> > exit
> > scp user at host.com:/home/user/backup.tgz /data/save/code
> > PASSWORD
> > ssh user at host.com
> > PASSWORD
> > rm /home/user/dbbackup.txt
> > rm /home/user/backup.tgz
> 
> 
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
> sent to listmaster at ale dot org.
> 



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list