[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

want to use SCP without password

Hi Guys,
I need to transfer some of the files from source to target host through SCP in a shell script, but how can I achieve this without asking password for oracle user
4 Solutions
Swadhin RaySenior Technical Engineer Commented:
nirvairghumanAuthor Commented:
I want to use SCP not FTP.
see if the following link on How To scp, ssh and rsync without prompting for password helps:
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Christopher Raymond MendozaCommented:
nirvairghumanAuthor Commented:
the syntax to create the key pair is:

ssh-keygen -t rsa

Thanks a lot i went through the link and got helpful information. Can you please explain how to use above command.
On the server from which scp will be run, as the user that will run the scp issue the command listed and hit enter to every question it asks.

You will get two files generated in the ~/.ssh/ directory - id_rsa (private key) and id_rsa.pub (public key)

On the server to which scp will connect as the user on that machine to which scp will connect, create directory ~/.ssh (if it does not exist already) and append (or create if does not exist0 the contents of id_rsa.pub to the file called authorized_keys .
Check that the permissions are user read/write/execute on ~/.ssh dir and user read/write on the authorized_keys file.
Then you will be able to ssh, scp and sftp without passwords.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now