I need to login to remotemachines through ssh and move some logfiles to my localmachine. My servername,username and password will be store in the .profile file. can any one please help me in this?
This will be a cronjob so Password can't be enter at run time.
Hi subin_bala.
If your local machine is Linux/UNIX, and you are talking about syslog, you might want to configure a "loghost" on those servers so that they send their logs to your local machine.
Have a look at your syslogd man pages, there are usually examples on how to do this.
Regards.
If you are using ssh key authentication, it should be be as simple as:
scp user@remotehost:/remote/dir/file /local/dir
if necessary to remove remote files use:
ssh user@remotehost "rm /remote/dir/file"