SCP ÃüÁî¸ú CP ÃüÁîÀàËÆ£¬Ö»²»¹ýCPÃüÁîÊÇÔÚͬһ̨»úÆ÷ÉÏÓõģ¬SCPÊÇÔÚ2̨»úÆ÷Éϸ´ÖƵÄÃüÁî¡£
¾ÙÀý˵Ã÷£º
¸´ÖÆÔ¶³Ì·þÎñÆ÷µÄÎļþµ½±¾µØ
scp -P 999 root@haohailuo.com:/home/test.zip /home/¸´ÖƱ¾µØµÄĿ¼µ½Ô¶³Ì·þÎñÆ÷
scp -P 999 -r /home/andy/ root@haohailuo.com:/home/
SCP ÃüÁîÓï·¨
scp [-1245BCpqrv] [-c cipher] [F ssh_config] [-I identity_file] [-l
limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:] file1 [¡]
[[suer@]host2:]file2
SCP ÃüÁî˵Ã÷
ScpÔÚÖ÷»ú¼ä¸´ÖÆÎļþ¡£ËûʹÓà ssh(1)×÷ΪÊý¾Ý´«Êä¡£¶øÇÒÓÃͬÑùÈÏÖ¤ºÍ°²È«ÐÔ¡£ scp½«ÔÚÈÏÖ¤ÖÐÇëÇóÊäÈëÃÜÂëËùÓеÄÎļþ¿ÉÄÜÐèÒª·þÎñÆ÷ºÍÓû§µÄÌرðÃèÊöÀ´Ö¸Ã÷Îļþ½«±»¸´ÖƵ½/´Óij̨·þÎñÆ÷¡£Á½¸öÔ¶³ÌµÇ¼µÄ·þÎñÆ÷¼äµÄÎļþ¸´ÖÆÊÇÔÊÐíµÄ¡£
SCP ÃüÁîÑ¡Ïî
-1 Ç¿ÖÆscp ÓÃÐÒé1
-2 Ç¿ÖÆscp ÓÃÐÒé2
-4 Ç¿ÖÆscpÓÃIPV4µÄÍøÖ·
-6 Ç¿ÖÆscpÓÃIPV6µÄÍøÖ·
-B Ñ¡ÔñÅú´¦Àíģʽ£¨·ÀÖ¹ÊäÈëÃÜÂ룩
-C ÔÊÐíѹËõ¡£ ±ê×¢-Cµ½ssh(1)À´ÔÊÐíѹËõ
-c cipher
Ñ¡ÔñcipherÀ´¼ÓÃÜÊý¾Ý´«Êä¡£Õâ¸öÑ¡ÏîÖ±½Ó´«µÝµ½ssh(1)
-F ssh_config
É趨һ¸ö¿É±ä¶¯µÄÓû§ÅäÖøøssh.Õâ¸öÑ¡ÏîÖ±½Ó»á±»´«µÝµ½ssh(1)
-i identity_file
Ñ¡Ôñ±»RSAÈÏÖ¤¶Áȡ˽ÓÐÃÜÂëµÄÎļþ¡£Õâ¸öÑ¡Ïî¿ÉÒÔÖ±½Ó±»´«µÝµ½ssh(1)
-l limit
ÏÞÖÆ´«Êä´ø¿í£¬Ò²¾ÍÊÇËÙ¶È ÓÃKbit/sµÄËÙ¶È
-o ssh_option
¿ÉÒÔ°Ñssh_configÖеÄÅäÖøñʽ´«µ½sshÖС£ÕâÖÖģʽ¶ÔÓÚ˵Ã÷ûÓжÀÁ¢µÄscpÎļþÖжϷûµÄscpºÜÓаïÖú¡£¹ØÓÚÑ¡ÏîµÄÈçÏ¡£¶øËûÃǵÄÖµÇë²Î¿´ssh_config(5)
-P port
Ö¸¶¨Á¬½ÓÔ¶³ÌÁ¬½Ó¶Ë¿Ú¡£×¢ÒâÕâ¸öÑ¡ÏîÐèҪд³É´óдµÄģʽ¡£ÒòΪ-pÒѾÔç±£ÁôÁË´ÎÊýºÍģʽ
-S program
Ö¸¶¨Ò»¸ö¼ÓÃܳÌÐò¡£Õâ¸ö³ÌÐò±ØÐë¿É¶ÁËùÓÐssh(1)µÄÑ¡Ïî¡£
-p Ö¸¶¨Ð޸ĴÎÊý£¬Á¬½Ó´ÎÊý£¬»¹ÓжÔÓÚÔÎļþµÄģʽ
-q °Ñ½ø¶È²ÎÊý¹Øµô
-r µÝ¹éµÄ¸´ÖÆÕû¸öÎļþ¼Ð
-S program
Ö¸¶¨Ò»¸ö¼ÓÃܳÌÐò¡£Õâ¸ö³ÌÐò±ØÐë¿É¶ÁËùÓÐssh(1)µÄÑ¡Ïî¡£
-V ÈßÓàģʽ¡£ Èà scp ºÍ ssh(1) ´òÓ¡ËûÃǵÄÅÅ´íÐÅÏ¢£¬ Õâ¸öÔÚÅÅ´íÁ¬½Ó£¬ÈÏÖ¤£¬ºÍÅäÖÃÖзdz£ÓÐÓá£
SCP ÃüÁîÕï¶Ï
scp ·µ»Ø0 ³É¹¦Ê±£¬²»³É¹¦Ê±·µ»ØÖµ´óÓÚ0
SCP ÃüÁî²»ÐèÒªÊäÈëÓû§ÃÜÂëµÄʹÓ÷½·¨
ÔÚÁ½Ì¨»úÆ÷µÄÁ½¸öÓû§Ö®¼ä½¨Á¢°²È«µÄÐÅÈιØϵºó£¬¿ÉʵÏÖÖ´ÐÐscpÃüÁîʱ²»ÐèÒªÊäÈëÓû§ÃÜÂë¡£
1. ÔÚ»úÆ÷AÉÏrootÓû§Ö´ÐÐ ssh-keygen ÃüÁÉú³É½¨Á¢°²È«ÐÅÈιØϵµÄÖ¤Êé¡£
[root@A root]# ssh-keygen -b 1024 -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): <¨C Ö±½ÓÊäÈë»Ø³µ Enter passphrase (empty for no passphrase): <¨C Ö±½ÓÊäÈë»Ø³µ Enter same passphrase again: <¨C Ö±½ÓÊäÈë»Ø³µ Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: ¡¡
×¢Ò⣺ÔÚ³ÌÐòÌáʾÊäÈë passphrase ʱֱ½ÓÊäÈë»Ø³µ£¬±íʾÎÞÖ¤ÊéÃÜÂë¡£
ÉÏÊöÃüÁÉú³É˽Կ֤Êé id_rsa ºÍ¹«Ô¿Ö¤Êé id_rsa.pub£¬´æ·ÅÔÚÓû§Ä¿Â¼µÄ .ssh ×ÓĿ¼ÖС£
2. ½«¹«Ô¿Ö¤Êé id_rsa.pub ¸´ÖƵ½»úÆ÷BµÄrootĿ¼µÄ.ssh×ÓĿ¼ÖУ¬Í¬Ê±½«ÎļþÃû¸ü»»Îªauthorized_keys¡£
[root@A root]# scp -p .ssh/id_rsa.pub root@»úÆ÷BµÄIP:/root/.ssh/authorized_keys root@192.168.3.206¡¯s password: <¨C ÊäÈë»úÆ÷BµÄrootÓû§ÃÜÂëÔÚÖ´ÐÐÉÏÊöÃüÁîʱ£¬Á½Ì¨»úÆ÷µÄrootÓû§Ö®¼ä»¹Î´½¨Á¢°²È«ÐÅÈιØϵ£¬ËùÒÔ»¹ÐèÒªÊäÈë»úÆ÷BµÄrootÓû§ÃÜÂë¡£
¾¹ýÒÔÉÏ2²½£¬¾ÍÔÚ»úÆ÷AµÄrootºÍ»úÆ÷BµÄrootÖ®¼ä½¨Á¢°²È«ÐÅÈιØϵ¡£ÏÂÃæÎÒÃÇ¿´¿´Ð§¹û£º
[root@A root]# scp -p test root@»úÆ÷BµÄIPµØÖ·:/root³É¹¦ÁË£¡ÕæµÄ²»ÔÙÐèÒªÊäÈëÃÜÂëÁË¡£
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ