Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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)?
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.
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.
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...
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:
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.