Linux SCP and SSH commands

Source: Internet
Author: User
Oracle experiments are usually performed, data is often transferred between multiple hosts, or data is logged on, these two commands are often used
Here we will introduce the simplest examples to avoid forgetting them.

(I) SCP

SCP is a command used to copy and transmit data between two machines. Its essence is equivalent to the CP command used to transmit data over ssh.

Copy remote server files to local:

[root@Think ~]# scp  192.168.1.117:/home/oracle/water.txt /root/Desktoproot@192.168.1.117's password: water.txt                                                                                    100%   10KB  10.1KB/s   00:00    

Copy the directory of the remote server to the local device.:

[root@Think ~]# scp -r 192.168.1.117:/home/oracle/ /root/Desktoproot@192.168.1.117's password: copy.sh                                                                                      100% 1375     1.3KB/s   00:00    sqlnet.log                                                                                   100%  766     0.8KB/s   00:00    

Copy local files to the remote server:

[root@Think Desktop]# scp Think.sql 192.168.1.117:/root/Desktoproot@192.168.1.117's password: Think.sql                                     100%    0     0.0KB/s   00:00 

Copy the local directory to the remote server:

[root@Think ~]# scp -r /root/Desktop 192.168.1.117:/root/Desktoproot@192.168.1.117's password: a                                             100%   17     0.0KB/s   00:00    login.sql                                     100%  638     0.6KB/s   00:00    

(Ii) SSH

Unspecified user
:

[root@Think ~]# ssh 192.168.1.117root@192.168.1.117's password: Last login: Fri Mar  8 20:49:53 2013

Specified user:

[Root @ think ~] # Ssh-l the Oracle 192.168.1.117oracle@192.168.1.117's password: or [root @ think ~] # SSH oracle@192.168.1.117oracle @ 192.168.1.117's password: Last login: Fri Mar 8 21:42:06 2013 from 192.168.1.118

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.