1833926 Members
3701 Online
110063 Solutions
New Discussion

Re: Unattendes ssh

 
SOLVED
Go to solution
Lukas Grijander
Advisor

Unattendes ssh

Hi all.

I've just installed openssh 3.1p1

I'm using ssh as a substitute of telnet, it works fine, but ...

Now, I need to use it like I'm ussing rcp and rsh (not restricted shell, r* command) :

machine1 # rsh machine2 ls -l

whithout giving password, using .rhosts file

machine1 # ssh machine2 ls -l

ask me for password ...

How can I do it?

Thanks in advance.

Rafa
4 REPLIES 4
Darrell Allen
Honored Contributor
Solution

Re: Unattendes ssh

Hi Rafa,

Check out this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x319d8cc5e03fd6118fff0090279cd0f9,00.html

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Craig Rants
Honored Contributor

Re: Unattendes ssh

Attached are my notes for installation and trust configuration. Let me know if you have any problems.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Lukas Grijander
Advisor

Re: Unattendes ssh

THANK YOU VERY MUCH
Sridhar Bhaskarla
Honored Contributor

Re: Unattendes ssh

Hi Rafael,

You need to generate your public/private key pair and copy the public key to the other system.

Before that you need to start sshd and if you haven't already done, use the following process to generate host key.

On system A have sshd runnign with the following procedure.

#/opt/openssh2/bin/ssh_keygen -t rsa1 -f /opt/openssh2/etc/ssh_host_key -N ""
#/opt/openssh2/bin/ssh_keygen -t rsa -f /opt/openssh2/etc/ssh_host_rsa_key -N ""
#/opt/openssh2/bin/ssh_keygen -t dsa -f /opt/openssh2/etc/ssh_host_dsa_key -N ""

Start sshd
#/opt/openssh2/sbin/sshd

Following the above procedure for system B if you want to do ssh from system A to system B.

Setup SSH-client on systemB

Generate public/private key pair on systemB

#/opt/openssh2/bin/ssh_keygen

(take the default file for the key and enter a passphrase here.. you need to remember)

#Now ftp $HOME/.ssh/identity.pub to systemA and append it to $HOME/.ssh/authorized_keys. If you don't have authorized_keys.

Now do ssh from systemB to systemA.

systemB#ssh systemA ls -al

Now this should ask for the passphrase that you typed in while creating the key. After typing in the passphrase, it should execute ls -al on system A.

However, here you still need to type the passphrase. There is a way to remember the passphrases in the memory. You need to use ssh-agent to remember the passphrases.

systemB#eval `/opt/openssh2/bin/ssh-agent -s` /opt/openssh2/bin/ssh-add
This will ask for the passphrase. Type in and it will be remembered.
systemB# ssh systemA ll
systemB# ssh systemA cat /etc/passwd

Repeat the same procedure on systemA if you need the otherway.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try