Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to get harddisk's free space available from 7 Windows 2008 servers and 4 Linux machines. For windows machines I wrote a tiny .Net Program. This will get details from all windows machines. In Linux machine I used

df -h 

command. And I used the following command

ssh username@linuxmachine df -h 

to get details from other Linux machine. But this command asks for password every time. Is there any way to get hard disk details from all Linux machines ? OR is there any way to get Linux machine's partition's details from a windows machine ?

All Linux machines have same username and password.

PS: I don't have any knowledge on shell scripting. kindly elaborate your solutions :)

share|improve this question

migrated from stackoverflow.com Mar 15 '13 at 15:18

This question came from our site for professional and enthusiast programmers.

    
You could use a passphraseless ssh key. Here is a how to for it passphraseless ssh key wiki.hands.com/howto/passphraseless-ssh – Max Burucker Mar 15 '13 at 9:52
up vote 1 down vote accepted

You can use public/private key pairs for authentication. First generate public/private key. On linux you can do this:

ssh-keygen

You can find the keys in your homedir in .ssh :

ceco@persika ~/.ssh $ ls id_rsa*
id_rsa  id_rsa.pub

Then distribute public key on the machines you want to log in:

ssh-copy-id MACHINE_IP_ADDR

It will ask you for password and you are good to go. The public key is saved in ~/.ssh/authorized_keys. After this procedure you can make passwordless logins. I won't discuss security risks about this - I believe you are aware what might go wrong :)

share|improve this answer
    
Thanks for your response. I will try this. Could you please provide me a shell script for getting free spaces from all Linux machines ? – Sravan Mar 15 '13 at 10:28
    
Your command should do the job (ssh username@linuxmachine df -h). – tsv.dimitrov Mar 15 '13 at 10:31
    
Thanks.. This Worked for me :) – Sravan Mar 15 '13 at 15:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .