Linux SCP 和 SSH 命令

來源:互聯網
上載者:User
       平時做Oracle實驗、經常會在多個主機間傳資料或者登入、這兩個命令經常用到
       這裡以最簡單的執行個體介紹一下、以免自己忘了
       
        ㈠ SCP 
          
          scp是在兩台機器間複製傳輸資料的命令、其實質相當於利用SSH協議來傳輸資料的cp命令
          

          複製遠程伺服器的檔案到本地

[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    

          複製遠程伺服器的目錄到本地

[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    

          複製本地的檔案到遠程伺服器

[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 

          複製本地的目錄到遠程伺服器

[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    

       ㈡ SSH
          
          不指定使用者

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

          指定使用者

[root@Think ~]# ssh -l oracle 192.168.1.117oracle@192.168.1.117's password: 或者[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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.