How to setup a password less ftp??

hi,

i want to setup a password less FTP to a remote server so that i can ftp to a remote server without the password.
i have setup a passwordless ssh and i am able to use scp commands to connect to the remote server without asking for the password. but when i try to ftp to the same remote server, it still asks for the password. is it possible to set up a passwordless ftp also?

Yes use 'sftp', this is an example:

#!/usr/bin/ksh
# test_sftp.sh
sftp -b /dev/stdin -v -o BatchMode=yes -o IdentityFile=/export/home/user/.ssh/id_rsa -o Port=22 user@host <<ENDSFTP
cd /home/user/test
put /export/home/user/test/test.txt test.txt.xferring
rename test.txt.xferring test.txt
quit
ENDSFTP
rc=$?
if [[ $rc != 0 ]]    then
    print "Error occured...$rc" `date "+%Y-%m-%d-%H.%M.%S"`
else
 print "Successful transfer...$rc" `date "+%Y-%m-%d-%H.%M.%S"`
fi

FTP and ssh are wholly different.

ssh includes the sftp protocol though, which is enough like ftp to perhaps solve the same problem for you, and logs in the exact same way as ssh -- it should use the exact same keys.

i have created a .netrc file in my home directory for ftp to work without prompting for password. Is it ok and safe?

Its ok to use but not completely safe. Super users and specific sudo users can read this file even if you protect it with permissions.

so is there any other solution? i think its not possible to create rsa private and public keys and copy the public key in remote servers authenticated_keys file. this works only for sftp that uses ssh. FTP still prompts for password. any other way?

I dont think you have many options than .netrc for simple ftp.