Quote:
Originally Posted by
ChandruBala73
'Establish passwordless' is not possible for me hence i have changed my mind to write a script for all 5 servers separately.
I am not sure why this is a bettwer way to do this. "passwordless" means: create a secure-key with
ssh-keygen on the system you want to run the script from. The resulting file is usually located in
/your/homedir/.ssh in a file named (if you use the default RSA encryption)
id_rsa.pub. Open/create the fle
/home/of/user/.ssh/authorized_keys on the remote machine you want to connect to and append the content of the local file
id_rsa.pub there. Now the user from the system you generated the key at is allowed to connect as the user where you stored the keyfile at without password. The user is not identified by the password but by the key you transmitted.
Quote:
Originally Posted by
ChandruBala73
If i use that command mentioned earlier , some zero byte files are coming which is actually note in my scope. I want took all the paths which is not in our scope and now i want a script which should connect a single IP through ssh and gives me an output of zero byte file excluding the paths not in our scope which has zero byte.
Actually the script i gave you does exactly this: it connects to a single machine, issues the command, saves its outcome, then goes on to do the same to the next machine on the list. To cut some paths from
finds scope there are two ways: use the "-prune" option to prune away some paths you are not interested in or use
grep -v to cut out from the output what doesn't peak your interest.
You might want to search this forum for "find" and "prune" with the "advanced search" feature to find out how this is done. It is the preferable way to do it.
I hope this helps.
bakunin
Moderator's Comments:
|
|
addendum: i just noticed that this has landed in the wrong forum. I move this over to "Unix for Dummies"
|
|