scp without password

Hello experts,

OS : CentOS

Could you please help me with the following scenario :

I wish to use scp command in order to copy a file (say : f1.txt) from server 2 to server 1.

Both servers have a common user (say : user1) configured. Also, the file is owned by the same user on both servers.

Could you please provide the command for the same such that whenever the scp command is executed, then the prompt for password is skipped.

scp code being used :

scp user2@server2:f1.txt /some/local/directory
 

Limitations :

  1. No changes in any system file(s).
  2. No scripts to be used.
  3. No use of ssh keygen .
  4. No use of sshpass command

Regards,
Haider

Why such limitations?
The idea of using secure shell suite is mosltly that: after having a secured ( crypted) connection, using keys so there is no more need of entering passwords...

The only other alternative is using a file in home directory but that would be seen by your admins as a security breach... ( my opinion is more temperate...)

"No use of sshpass" is a perfectly sane limitation. sshpass is an insecure shoehorn with very few legitimate uses.

"no use of keys" is not - unless their intention was to explicitly prevent all automation.