Passwordless file transfer using sftp

Hello all,

I have a requirement, in which we need to stage a package to Unix remote server in an automation (we cant use ssh key generation) , do u have any idea how we can transfer the package to remote server using sftp .if you have any script plz share it to me

Without ssh keys i dont think one can do passwordless sftp transfer

Thanks for your quick reply. but i heard that using expect we can transfer it. thats y i checked is there is any way .please help me

No. Expect can only do what you can do on a terminal without you need to type them yourself.

You write expect scripts that:

  1. type what you would type live (you can use shell variables for things like file names)
  2. expect has to "read" exactly what the remote application sends and answer correctly.
  3. error handling is mostly 'expect did not get what it was expecting to get back'
    So when things have problems you do not necessarily get good troubleshooting information in logs. Things like files with spaces or unprintable characters in the names and other junk that human typists create.

So if all your input is something like filenames programs created, you are good. If Joe Fumblefingers gets to enter filenames for the app, good luck. In the latter case: Using expect means expect phone calls at 2:00am