LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 03-11-2007, 06:36 AM   #1
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Rep: Reputation: 15
ssh keys


I have downloaded a script fro mthe internetwhich checks system performance counters such as ram, disk,cpu etc. and notifies to root throufh e-mail. But when i run this script , a password prompt appears for ssh keys. I ran the command

ssh-keygen -t rsa -b 1024

i entered the passphrase password and again run the script ..entered the passphrase , but didnot accept the password entered in the above command.

I checked on the internet to find out the solution but most of the documentation contains sending ssh keys to remote computer.. i had just run the above command and nothing else to generate the keys what else do i need to do so that password is accepted
 
Old 03-11-2007, 06:41 AM   #2
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
What script have you downloaded? Can you provide a URL? It may not be using the keys you have created. What files have you got in your .ssh directory (under the users home directory)?
 
Old 03-11-2007, 07:23 AM   #3
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
link

I am using RHEL.pl check the link and recommend what should i do

http://bash.cyberciti.biz/monitoring...ation.bash.php

this is the link and files under home directory of root

-rw------- 1 root root 736 Mar 11 14:01 id_dsa
-rw-r--r-- 1 root root 611 Mar 11 14:01 id_dsa.pub
 
Old 03-11-2007, 07:29 AM   #4
dannystaple
Member
 
Registered: Apr 2006
Location: London, Uk
Distribution: Ubuntu on Desktop
Posts: 121

Rep: Reputation: 15
Quote:
Originally Posted by sachin1361
I am using RHEL.pl check the link and recommend what should i do

http://bash.cyberciti.biz/monitoring...ation.bash.php

this is the link and files under home directory of root

-rw------- 1 root root 736 Mar 11 14:01 id_dsa
-rw-r--r-- 1 root root 611 Mar 11 14:01 id_dsa.pub
Ah - I see. To use ssh keys, you need to make sure your public key is in the authorized hosts file of the host that the script will ssh to, and both keys are locally in the .ssh directory of the user running the script ~/.ssh.

As it uses SSH, if the key is failing (whichh it currently will be), then the password it is prompting for is not a key password, but just the password for the user it is logging into the remote machine with. Note that if that is root, then it may go through the motions of asking for a password, but not let you in - many distro's have a setup that will deny root access via ssh.

Danny
 
Old 03-11-2007, 07:36 AM   #5
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
???

well..what should i do now ???
becoz it is not accepting even root password

U have all the config right now.In this scenario what command should i enter to run this script
 
Old 03-11-2007, 08:16 AM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
First have you fully setup ssh?
Then do you have the sshd service running?
Next have you set the correct permissions for ~/.ssh and ~./ssh/authorized_keys.
For most of that follow these links.
http://www.g-loaded.eu/2005/11/10/ssh-with-keys/
http://www.suso.org/docs/shell/ssh.sdf

Next looking over the script you have set the variables for usr to point to your username on the IP you are ssh too. ( NOT ROOT HERE ). You do not ssh as root. Normal defaults should not allow root to login to a user by the name root to login to an ssh server.
Then set the variable to the IP it is to send the data to.

Lets stop there and get ssh working.
 
Old 03-11-2007, 08:58 AM   #7
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
thanx buddy for your help..i took ur more time

I am now fed up with this and leaving to home...

ssh is working properly ..users are connecting with it...no problem to user when login to ssh ..ssh accept passpharse and their own passwords..

But when i execute this script, it always keep on asking passpharse and user password...a loop is created.. no password error becoz i have entered the correct one...but again and again asking the password...

i donot know what the hell is this password...

thanx dear..i think there is some prob with the script...

if u have the time ...pl check it on ur system..i have send u the link...

all d best
 
Old 03-11-2007, 11:18 AM   #8
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Well I gave the script a try and it and it works fine on my end. After studying it I know what you are seeing. It keeps asking you the passphrase because it executes a single command per ssh connection so to gather all that info it runs the ssh command about 10 or so times. After you enter the passphrase that many times the script will end and send the output file to /var/www/html/info.html. Then in a browser you can display that page.

So to check the remote machine run the script from the local machine to the IP of the remote machine. Enter passphrase 10 times roughly. Then check the file /var/www/html/info.html on the local machine in a browser. You need write permission to that directory if you are a user. You can send the output to place. For my test I sent to my home directory like this ~/info1.html for one server. Then ~/info2.html the next one. Created seperate scripts for each one.

Now for the constant key asking I use an ssh-agent to enable passphrases to be executed when ask so as I am not required to enter them anytime I login to my remote servers. The links from above post mention ssh-agent. Or I use kssh-agent.

Also downloaded the gifs from the forum link in the script.

Brian

Last edited by Brian1; 03-11-2007 at 11:41 AM.
 
Old 03-12-2007, 12:49 AM   #9
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
done

Thanx dear...

prob solved but I could get what is the reason for entering passwords so many times ??????/

Anyway script is executed finally..
 
Old 03-12-2007, 05:18 PM   #10
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
What did you finally do to get it working?

The reason for enter the passphrase so many times is because the script run seems to run each of the commands on the remote system to gather each piece of information. I personally having a bit of trouble looking over the script. To me it would be better to run the items on the machine itself once every 5 minutes or so and then all one needs to do is get the finally output.html doc from the machine itself.

Brian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH keys alon005 Linux - Security 5 10-14-2004 03:39 AM
ssh keys merchtemeagle Linux - Newbie 4 10-12-2004 12:12 AM
ssh keys Lucasite Linux - Security 2 03-11-2004 12:43 PM
Configuring SSH to accept only keys (already have keys) fr0st Linux - Security 3 11-04-2003 03:31 AM
SSh Keys shaggz Linux - General 2 02-19-2003 09:09 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 08:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration