without password to login into remote machine- in the script ??

HI,

I need to write a script ..

when I run this script , will directly goto that remote machine without asking password..

Once it is entered, I needs to transfer some of the log files...

how can I proceed ?

If you can ssh to the remote server, then you can use scp or sftp to transfer the log files without password.

For this you need to generate ssh keys from your server, so you can send your key to the account on the remote server and add to authorized_keys file onthe remote server. This will enable you to log on without password or scp / sftp without password

explore expect or with perl using CPAN module Net:SSH

Example Script

#!/usr/local/bin/expect --

set timeout 20

set server "[lindex $argv 0]"
set username "[lindex $argv 1]"
set password "[lindex $argv 2]"
spawn telnet $server
expect "login:"
send "$username\r"
expect "Password:"
send "$password\r"
expect "% "
send "ls\r"
expect "% "

Only problem with using expect / telnet is that your password has to be in a script and its plain on the network..

but if security isnt a worry ( not for me... just bloody security group ) then its fine.. if not, then ssh is the way...

you can use rsh and rcp .

Check the man pages of these two for details

hi

please follow the steps in the link

http://www.ehow.com/how\_4750765_rsync-over-ssh-password.html

i got success after two days struggle.....the article may be misleading at some times . please read carefully

thanks to all,

it was working...

Now , the problem is==> with scp command I want to transfer the file in ascii mode.

I got to know that,, scp -a is not working..

I tried with ----- unix2dos file file

This is working fine..

Is their any way to do so , using scp or any other one ?/

-----Post Update-----

thanks to all,

it was working...

Now , the problem is==> with scp command I want to transfer the file in ascii mode.

I got to know that,, scp -a is not working..

I tried with ----- unix2dos file file

This is working fine..

Is their any way to do so , using scp or any other one ?/