Use sftp
instead of whatever command you are using in your .ksh script. See sftp man for reference.
You may also want to look at scp
secure copy - scp man.
EDIT
sftp
is mostly for interactive operations, you need to specify host you want to connect to:
sftp example.com
you will be prompted for username and passsword, and the interactive session will begin..
Although it can be used in scripts, the scp
is much more easy to use:
scp /path/to/localfile user@host:/path/to/dest
you will be prompted for password..
Edit 2
Both scp
and sftp
use ssh
as underlying protocol, see this and this
The best way to setup them to run from scripts is to setup passwordless authentication using keys. See this and this. I use this extensively on my servers.. After you setup keys, you can run
scp -i private-key-file /path/to/local/file user@host:/path/to/remote
sftp -oIdentityFile=private-key-file -b batch-file user@host
If you want to authenticate with password, you may try the expect
package. The simplest script may look like this:
#!/usr/bin/expect
spawn sftp -b batch-file user@host
expect "*?assword:*"
send "pasword\n"
interact
See this, this and this for more info.