LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Ssh passwordless : Urgent (https://www.linuxquestions.org/questions/linux-security-4/ssh-passwordless-urgent-213842/)

ERBRMN 04-26-2005 09:42 PM

Quote:

Originally posted by manojg
Hi Blinker_Fluid,

I tried. When I used the command "ssh-keygen -t dsa -f ~/.ssh/mykey" it asked to enter a passphrase. I entered a password.
After doing all these steps that you have suggested, I tried to ssh. The it again asked to enter "passphrase". So, it is not realy a passwordless connection. LAM/MPI requies connection without any external input.

Is there any thing missing?

Thanks.
Manoj

Did you add new public key file (with passphrase) to authorized key file of remote SSH server?

Like:
cat user_id.pub >> authorized_keys

There is:
user_id.pub - Your public key file with is create on your computer with "passphrase"
authorized_keys - Remote SSH server authorized key file

manojg 04-27-2005 08:07 AM

Hi Blinker_Fluid,

Sorry, I figured out this.

johnnydangerous 04-27-2005 08:24 AM

Quote:

Originally posted by manojg
Hi Blinker_Fluid,

I tried. When I used the command "ssh-keygen -t dsa -f ~/.ssh/mykey" it asked to enter a passphrase. I entered a password.
After doing all these steps that you have suggested, I tried to ssh. The it again asked to enter "passphrase". So, it is not realy a passwordless connection. LAM/MPI requies connection without any external input.

Is there any thing missing?

Thanks.
Manoj

dont enter password when generating just do a "enter" hit when asked !

Y0jiMb0 05-25-2005 05:40 AM

Quote:

#!/usr/bin/expect --

set timeout 180
set machine [lindex $argv 0]
set username [lindex $argv1]
set password [lindex $argv 2]
spawn ssh $username@$machine
expect "$username@$machine's password: "
send "$password\n"
interact
Thanks for posting this solution; however I found a bug:
if password begins with "-" it doesn't work. It interprets the password as an option. What can be done?

Another question, how secure is this?

Regards

johnnydangerous 05-25-2005 06:08 AM

Quote:

Originally posted by Y0jiMb0
Thanks for posting this solution; however I found a bug:
if password begins with "-" it doesn't work. It interprets the password as an option. What can be done?

Another question, how secure is this?

Regards

what is this script for?

Y0jiMb0 05-25-2005 12:13 PM

Quote:

what is this script for?
It was posted by vineet.k; it automates the process of ssh-ing. If you call it "sshlogin" (and give it proper permissions) it runs like this:

Code:

sshlogin node1 abc xyz
and what it does is: log into machine "node1", with username "abc" and password "xyz".
You can execute inside another script and you don't have to be prompted for the password every time. I know it is risky and ugly if you want, but I cannot manage to get working the public key stuff (as I don't have root access to the listener machine I don't know if I will be able to solve that question; I believe it is related to some conf file)

I hope to have clarified your question...
Anyway, mine still remains: how (un)secure is this thing?

Regards

vineet.k 05-25-2005 01:06 PM

SSHlogin
 
If your password starts with - then try using " " [quotes].
I have not tried this. Hope this should work.
Or sometimes it may take " " as a part of your password.

Every coin has two sides.

Got any other solution for this issue ?

One more problem is there. Since you are spawning a program with another, the child process will be limited to use the total memory allocated for the parent process.
Try sshlogin to a machine and then try listing ( ls -l ) a directory with not less that 100 files. At times the ls will go into an infinite loop, you can get out of it. (Even with Cntrl + C). Since it is a seperate process.


Take care.

Y0jiMb0 05-25-2005 03:23 PM

Quote:

If your password starts with - then try using " " [quotes].
I have not tried this. Hope this should work.
Or sometimes it may take " " as a part of your password.
Indeed I tried it and yes, it considers " just another character of the password.
If must be something simple, but I can't find the good side of the coin...

Any "expect" expert around here?

Regards

kevingpo 06-21-2005 08:26 PM

Quote:

Originally posted by Blinker_Fluid
hosts.equiv is rsh it is not ssh. <snip>
You mention about rsh, and hosts.equiv file. But in the previous postings there hasn't been any reference or query about this matter.

However, how do you use the hosts.equiv file to get passwordless rsh?


All times are GMT -5. The time now is 02:10 PM.