Public key to connect from one ftp server to other server

How to generate public key to connect from one ftp server to other server to use in scripting.

FTP doesn't use a "key" per se.

Search the man page for ftp for "netrc".

If you want to take the more secure route by using sftp, then you can Google for "ssh passwordless login", or something like that.

It generally involves running ssh-keygen on the client server and copying the public part of the key to the other server's authorized_keys file.