[olug] Help ssh

Brian Wiese bwiese at cotse.com
Thu Oct 17 06:28:18 UTC 2002


sharing my experience...

I thought I'd finally try this out... but had some problems.  First of
all, I wanted a passphrase, so I did that.  I copied my public key over to
my server, and actually renamed it to that authorized_keys2 file. 
Locally, I ran...

bwiese at liberty:~> ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-XXaNuU5m/agent.32120; export SSH_AUTH_SOCK;
SSH_AGENT_PID=32121; export SSH_AGENT_PID;
echo Agent pid 32121;
bwiese at liberty:~> ssh-add
Could not open a connection to your authentication agent.

so, google'd this, and found my problem, or - found an answer.  I was
envoking ssh-agent wrong, this webpage: 
http://ssh.inet-one.com/dir.1999-10/msg00168.html

told me I should use 
	eval `ssh-agent`    ### thats with tick marks

I wonder why this is necessary, or different, but it works!

bwiese at liberty:~> eval `ssh-agent`
Agent pid 32164
bwiese at liberty:~> ssh-add
/home/bwiese/.ssh/id_rsa: No such file or directory
Enter passphrase for /home/bwiese/.ssh/id_dsa:
Identity added: /home/bwiese/.ssh/id_dsa (/home/bwiese/.ssh/id_dsa)
/home/bwiese/.ssh/identity: No such file or directory

I only made a DSA key originally, so thats why you see the 'errors'. 

I agree though, this site was a help:
http://www.csua.berkeley.edu/ssh-howto.html

So this acts as like a single sign on for you at your client machine, when
you start the ssh-agent and ssh-add, you authenticate yourself... then
whenever you want to ssh to another host with the defined username,
ssh-agent passes on your authentication for you - and your passphrase/word
doesn't go over the wire each time, and you dont have to type it each
time. very nice.  I'll add this to my .xsession file for each logon. =)

  #!/bin/sh
 
  # Start ssh agent.
  eval `/usr/local/bin/ssh-agent -s`
  /usr/local/bin/ssh-add < /dev/null


thanks Buz and Dave.

peace
Brian

On Wed, 16 Oct 2002 07:41:40 -0500
David Walker <linux_user at grax.com> wrote:

|On client machine:
|ssh-keygen -d
|
|just hit enter when prompted for a passphrase if you want this to run
without 
|user intervention
|
|scp ~/.ssh/id_dsa.pub server_machine:/home/(username)/.ssh/my_key.pub
|ssh server_machine
|	cd ~/.ssh/
|      if authorized_keys2 does not exist
|	mv my_key.pub authorized_keys2
|      if it does exist
|	cat my_key.pub authorized_keys2 > authorized_keys2.new
|	mv authorized_keys2.new authorized_keys2
|
|	check that authorized_keys2 is owned by you and make the permissions rw
(600)
|
|now "ssh server_machine" should connect with no password and in a secure 
|manner
|
|ssh server_machine "cd /some/other/directory; some_command"
|should work now
|
|On Wednesday 16 October 2002 05:29 am, (Via wrote:
|> Hi
|> I want to run executable file from the remote host
|> automatically after ssh command.
|> e.g
|> in a batch script I want to do the following
|>    - ssh remote host
|>    - change directory
|>    - run the executable file in the directory chosen
|> from above.
|>
|> Can anyone help
|> Thanks
|> Eric
|>
|> __________________________________________________
|> Do you Yahoo!?
|> Faith Hill - Exclusive Performances, Videos & More
|> http://faith.yahoo.com
|> _______________________________________________
|> OLUG mailing list
|> OLUG at olug.org
|> http://lists.olug.org/mailman/listinfo/olug
|
|_______________________________________________
|OLUG mailing list
|OLUG at olug.org
|http://lists.olug.org/mailman/listinfo/olug
|


  Brian Wiese | bwiese at cotse.com | aim: unolinuxguru
------------------------------------------------------
  GnuPG/PGP key 0x1E820A73 | "FREEDOM!" - Braveheart 
------------------------------------------------------  
This is not about Napster or DVDs. It's about your Freedom.
  I'll see your DMCA and raise you a First Amendment.
              http://www.anti-dmca.org



More information about the OLUG mailing list