ssh scp

来源:互联网 发布:python金融大数据 pdf 编辑:程序博客网 时间:2024/05/16 17:35
ssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] [-D  [bind_address:]port] [-e escape_char]
         [-F configfile] [-i identity_file] [-L  [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec]
         [-O ctl_cmd] [-o option] [-p port] [-R  [bind_address:]port:host:hostport] [-S ctl_path]

         [-w local_tun[:remote_tun]] [user@]hostname [command]


scp - secure copy (remote file copy program)
     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit][-o ssh_option] [-P port][-S program]

         [[user@]host1:]file1 ... [[user@]host2:]file2

      scp中大写P配置端口,因为小写p被占用了。

      甚至支持两个remote设备之间copy。

 

     注意:scp的最后两个参数file1, file2不能挪到option参数之前,必须放在最后,否则出错。

              6.1版本中:scp包含参数'3',表示在两个remote设备之间copy时是否经过local设备;如果有3,则表示经过local转一遍,否则remote之间自己传输即可。



一、在-o或ssh_config中的

ConnectTimeout ------- 连接服务器时select的超时时间

ServerAliveInterval
ServerAliveCountMax   ---------- 连接成功后,后续select的超时时间

都很有用,控制select超时。在openssh 4.7版本中,后两个参数只是部分支持。6.1版本中,则完全支持。