PREPARED BY RAVI KUMAR LANKE Page 1
Copying files between linux machines using scp
and ssh without linux user passwords
PREPARED BY RAVI KUMAR LANKE Page 2
1. Setup ssh keys on both machines
To generate a public / private key pair :
$ ssh-keygen -t rsa
The above will generate 2 files, ~/.ssh/id_rsa (private key) and /home/ oracle /.ssh/id_rsa.pub (public key)
To setup the SSH keys for usage (one time task) : Copy the contents of /home/ oracle /.ssh/id_rsa.pub of source server and paste in a new line
of /home/ oracle /.ssh/authorized_keys of destination server
If /home/oracle/.ssh/authorized_keys doesn't exist, feel free to create it.
2. To copy files use the below command
change to destination directory in destination server and run the below command
$scp -i ~/.ssh/id_rsa oracle@source_server_hostname:/u01/oracle/backup/*.* .
Cron job :
make a shell script as below and save it as filescopy.sh:
#!/bin/sh
backup_dir="/home/oracle/ backup"
cd $backup_dir
scp -i ~/.ssh/id_rsa oracle@source_server_hostname:/home/oracle/backup/*.* .
Now run the cron job on the destination server with above script
$crontab -e
Enter the below line
*/2 * * * * /u01/filescopy.sh > /u01/backup.log 2>&1
save and exit
It will copy the files into the destination server for every 2 sec.

More Related Content

PPTX
Arcshell SSH Module Overview
PPTX
Hadoop presentation
PPT
Anandha ganesh linux1.ppt
PDF
linux-commandline-magic-Joomla-World-Conference-2014
PPTX
Bower introduction
PDF
Container Security
PDF
Top 10 Random Linux/Ubuntu Commands
PPT
Linux presentation
Arcshell SSH Module Overview
Hadoop presentation
Anandha ganesh linux1.ppt
linux-commandline-magic-Joomla-World-Conference-2014
Bower introduction
Container Security
Top 10 Random Linux/Ubuntu Commands
Linux presentation

What's hot (20)

PPT
Power point on linux commands,appache,php,mysql,html,css,web 2.0
PDF
Red Hat Linux cheat sheet
PDF
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
DOCX
PDF
Osquery
PDF
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
PPTX
Basics of-linux
PDF
Git it on (includes git hub)
PPTX
R brownbag seminar 2.2
PPTX
Unix slideshare
DOC
3 level cert tomcat
PPT
Shell programming
PPT
Apache
PPTX
Unix_basics
ODP
PDF
Using the command line on macOS
PDF
DSpace Manual for BALID Trainee
PDF
Linux system admin useful commands
PPTX
system management -shell programming by gaurav raikar
PDF
Introduction_Docker_TWM_20150323
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Red Hat Linux cheat sheet
Intro KaKao MRTE (MySQL Realtime Traffic Emulator)
Osquery
JDD 2017: Nginx + Lua = OpenResty (Marcin Stożek)
Basics of-linux
Git it on (includes git hub)
R brownbag seminar 2.2
Unix slideshare
3 level cert tomcat
Shell programming
Apache
Unix_basics
Using the command line on macOS
DSpace Manual for BALID Trainee
Linux system admin useful commands
system management -shell programming by gaurav raikar
Introduction_Docker_TWM_20150323
Ad

Viewers also liked (13)

PPSX
Tallglass Presentation
PDF
eerste verdieping presentatie tekening
DOC
Susan hollis cv resume july 2015
PDF
SMF or MMF? Which Is the Right Choice for Data Center Cabling?
PDF
Universal Studios
PDF
Photo work
PDF
Office of the Gov Volunteer Recognition
PDF
doorsnede A-A en B-B
PPTX
Existencialismo
PPTX
창의적 발상
PDF
Hyperion 11-1-2-3-installation-guide-on-linux
PDF
Installing solaris on virtual box and installing weblogic server
PDF
Installing and configuring oracle hyperion financial close management 11123
Tallglass Presentation
eerste verdieping presentatie tekening
Susan hollis cv resume july 2015
SMF or MMF? Which Is the Right Choice for Data Center Cabling?
Universal Studios
Photo work
Office of the Gov Volunteer Recognition
doorsnede A-A en B-B
Existencialismo
창의적 발상
Hyperion 11-1-2-3-installation-guide-on-linux
Installing solaris on virtual box and installing weblogic server
Installing and configuring oracle hyperion financial close management 11123
Ad

Similar to Copying files between linux machines using scp and ssh without linux user passwords (20)

PPT
Introduction to SSH
PDF
Ssh between ansible control node with that of target
PDF
SSH how to 2011
PDF
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
PPTX
BuildStuff.LT 2018 InSpec Workshop
PDF
Linux basic for CADD biologist
PDF
An introduction to SSH
PDF
SSH.pdf
DOCX
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
PPTX
InSpec Workshop at Velocity London 2018
PDF
Hadoop meet Rex(How to construct hadoop cluster with rex)
DOCX
allscripts.pdf-----schedule.sh------ #!binbash #ssh .docx
PPTX
2009 cluster user training
PPTX
Hadoop on osx
PPT
Apache Web Server Setup 2
PPTX
Ansible as configuration management tool for devops
PDF
How To Setup SSH Keys on CentOS 7
PPTX
Drupal from scratch
PDF
Using filesystem capabilities with rsync
DOCX
Clustering manual
Introduction to SSH
Ssh between ansible control node with that of target
SSH how to 2011
Hadoop 2.0 cluster setup on ubuntu 14.04 (64 bit)
BuildStuff.LT 2018 InSpec Workshop
Linux basic for CADD biologist
An introduction to SSH
SSH.pdf
Part 4 Scripting and Virtualization (due Week 7)Objectives1. .docx
InSpec Workshop at Velocity London 2018
Hadoop meet Rex(How to construct hadoop cluster with rex)
allscripts.pdf-----schedule.sh------ #!binbash #ssh .docx
2009 cluster user training
Hadoop on osx
Apache Web Server Setup 2
Ansible as configuration management tool for devops
How To Setup SSH Keys on CentOS 7
Drupal from scratch
Using filesystem capabilities with rsync
Clustering manual

More from Ravi Kumar Lanke (20)

PPTX
mariadb_odbc_step_by_step_implementation.pptx
PPTX
Local users and groups missing in windows 10.pptx
PPT
Steps for Multimedia Signal Processesing.ppt
PPT
An overview of concepts of Sentiment Analysis
PPT
Step by Step Oracle Virtual Manager Installation.ppt
PPTX
CA workload Automation Tool Power Point Presentation
PDF
Creating and configuring vnc sessions
PDF
Exporting schema to dmp file and importing it into other oracle database
PDF
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
PDF
Enabling remote desktop connection on windows 7 64 bit
PDF
Connecting to the remote database through sql developer without database clie...
PDF
Setting home path class path and path for java on windows 7
PDF
How to find ip and mac address
PDF
Step by step deployment of sampleappv406
PDF
Installing and configuring informatica 910 and dac 11 g on windows 64 bit
PDF
Installing bi applications 7.9.6.4 on obiee 11.1.1.7.0
PDF
Installing my sql on windows
PDF
How to prevent access to command prompt and registry editing tools and window...
PDF
How to disable and enable task manager
PDF
Deploying an application into oracle endeca tools and frame works
mariadb_odbc_step_by_step_implementation.pptx
Local users and groups missing in windows 10.pptx
Steps for Multimedia Signal Processesing.ppt
An overview of concepts of Sentiment Analysis
Step by Step Oracle Virtual Manager Installation.ppt
CA workload Automation Tool Power Point Presentation
Creating and configuring vnc sessions
Exporting schema to dmp file and importing it into other oracle database
Installing Endeca Server, Studio, Integrator ETL , Commerce and Platform Serv...
Enabling remote desktop connection on windows 7 64 bit
Connecting to the remote database through sql developer without database clie...
Setting home path class path and path for java on windows 7
How to find ip and mac address
Step by step deployment of sampleappv406
Installing and configuring informatica 910 and dac 11 g on windows 64 bit
Installing bi applications 7.9.6.4 on obiee 11.1.1.7.0
Installing my sql on windows
How to prevent access to command prompt and registry editing tools and window...
How to disable and enable task manager
Deploying an application into oracle endeca tools and frame works

Recently uploaded (20)

PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
Empowerment Technology for Senior High School Guide
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Complications of Minimal Access-Surgery.pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Literature_Review_methods_ BRACU_MKT426 course material
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
English Textual Question & Ans (12th Class).pdf
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PPTX
Module on health assessment of CHN. pptx
PPTX
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Empowerment Technology for Senior High School Guide
Introduction to pro and eukaryotes and differences.pptx
Complications of Minimal Access-Surgery.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Literature_Review_methods_ BRACU_MKT426 course material
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
B.Sc. DS Unit 2 Software Engineering.pptx
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
My India Quiz Book_20210205121199924.pdf
Journal of Dental Science - UDMY (2021).pdf
English Textual Question & Ans (12th Class).pdf
Core Concepts of Personalized Learning and Virtual Learning Environments
AI-driven educational solutions for real-life interventions in the Philippine...
Journal of Dental Science - UDMY (2020).pdf
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
Module on health assessment of CHN. pptx
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...

Copying files between linux machines using scp and ssh without linux user passwords

  • 1. PREPARED BY RAVI KUMAR LANKE Page 1 Copying files between linux machines using scp and ssh without linux user passwords
  • 2. PREPARED BY RAVI KUMAR LANKE Page 2 1. Setup ssh keys on both machines To generate a public / private key pair : $ ssh-keygen -t rsa The above will generate 2 files, ~/.ssh/id_rsa (private key) and /home/ oracle /.ssh/id_rsa.pub (public key) To setup the SSH keys for usage (one time task) : Copy the contents of /home/ oracle /.ssh/id_rsa.pub of source server and paste in a new line of /home/ oracle /.ssh/authorized_keys of destination server If /home/oracle/.ssh/authorized_keys doesn't exist, feel free to create it. 2. To copy files use the below command change to destination directory in destination server and run the below command $scp -i ~/.ssh/id_rsa oracle@source_server_hostname:/u01/oracle/backup/*.* . Cron job : make a shell script as below and save it as filescopy.sh: #!/bin/sh backup_dir="/home/oracle/ backup" cd $backup_dir scp -i ~/.ssh/id_rsa oracle@source_server_hostname:/home/oracle/backup/*.* . Now run the cron job on the destination server with above script $crontab -e Enter the below line */2 * * * * /u01/filescopy.sh > /u01/backup.log 2>&1 save and exit It will copy the files into the destination server for every 2 sec.