scp和rsync不起作用(ssh工作)

scp和rsync不起作用(ssh工作),第1张

概述在我的Debian Squeeze服务器中,scp和rsync似乎没有复制任何内容.适用于其他服务器(因此不是客户端问题).使用scp时,它只是创建一个空文件并等待. /etc/bash.bashrc包含[-z“$PS1”]&&也回到顶部. SSH工作正常.可能是什么问题? 诊断 foo.bar:大小为10899字节的纯文本文件 scp -vvv /tmp/foo.bar服务器:/ tmp Exe 在我的Debian Squeeze服务器中,scp和rsync似乎没有复制任何内容.适用于其他服务器(因此不是客户端问题).使用scp时,它只是创建一个空文件并等待. /etc/bash.bashrc包含[-z“$PS1”]&&也回到顶部. SSH工作正常.可能是什么问题?

诊断

foo.bar:大小为10899字节的纯文本文件

scp -vvv /tmp/foo.bar服务器:/ tmp

Executing: program /usr/bin/ssh host server,user (unspecifIEd),command scp -v -t -- /tmpOpenSSH_5.8p1-hpn13v10,OpenSSL 1.0.0d 8 Feb 2011deBUG1: Reading configuration data /home/alanhaggai/.ssh/configdeBUG1: Applying options for serverdeBUG1: Reading configuration data /etc/ssh/ssh_configdeBUG2: ssh_connect: needpriv 0deBUG1: Connecting to server.com [111.222.111.222] port 22.deBUG1: Connection established.deBUG3: Incorrect RSA1 IDentifIErdeBUG3: Could not load "/home/alanhaggai/.ssh/ID_rsa" as a RSA1 public keydeBUG2: key_type_from_name: unkNown key type '-----BEGIN'deBUG3: key_read: missing keytypedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG3: key_read: missing whitespacedeBUG2: key_type_from_name: unkNown key type '-----END'deBUG3: key_read: missing keytypedeBUG1: IDentity file /home/alanhaggai/.ssh/ID_rsa type 1deBUG1: IDentity file /home/alanhaggai/.ssh/ID_rsa-cert type -1deBUG1: IDentity file /home/alanhaggai/.ssh/ID_dsa type -1deBUG1: IDentity file /home/alanhaggai/.ssh/ID_dsa-cert type -1deBUG1: IDentity file /home/alanhaggai/.ssh/ID_ecdsa type -1deBUG1: IDentity file /home/alanhaggai/.ssh/ID_ecdsa-cert type -1deBUG1: Remote protocol version 2.0,remote software version OpenSSH_5.5p1 Debian-6deBUG1: match: OpenSSH_5.5p1 Debian-6 pat OpenSSH*deBUG1: Remote is NON-HPN awaredeBUG1: Enabling compatibility mode for protocol 2.0deBUG1: Local version string SSH-2.0-OpenSSH_5.8p1-hpn13v10deBUG2: fd 3 setting O_NONBLOCKdeBUG3: load_hostkeys: loading entrIEs for host "server.com" from file "/home/alanhaggai/.ssh/kNown_hosts"deBUG3: load_hostkeys: found key type RSA in file /home/alanhaggai/.ssh/kNown_hosts:1deBUG3: load_hostkeys: loaded 1 keysdeBUG3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsadeBUG1: SSH2_MSG_KEXINIT sentdeBUG1: SSH2_MSG_KEXINIT receiveddeBUG1: AUTH STATE IS 0deBUG2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffIE-hellman-group-exchange-sha256,diffIE-hellman-group-exchange-sha1,diffIE-hellman-group14-sha1,diffIE-hellman-group1-sha1deBUG2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dssdeBUG2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.sedeBUG2: kex_parse_kexinit: aes128-ctr,rijndael-cbc@lysator.liu.sedeBUG2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96deBUG2: kex_parse_kexinit: hmac-md5,hmac-md5-96deBUG2: kex_parse_kexinit: none,zlib@openssh.com,zlibdeBUG2: kex_parse_kexinit: none,zlibdeBUG2: kex_parse_kexinit: deBUG2: kex_parse_kexinit: deBUG2: kex_parse_kexinit: first_kex_follows 0 deBUG2: kex_parse_kexinit: reserved 0 deBUG2: kex_parse_kexinit: diffIE-hellman-group-exchange-sha256,diffIE-hellman-group1-sha1deBUG2: kex_parse_kexinit: ssh-rsa,zlib@openssh.comdeBUG2: kex_parse_kexinit: none,zlib@openssh.comdeBUG2: kex_parse_kexinit: deBUG2: kex_parse_kexinit: deBUG2: kex_parse_kexinit: first_kex_follows 0 deBUG2: kex_parse_kexinit: reserved 0 deBUG2: mac_setup: found hmac-md5deBUG1: REQUESTED ENC.name is 'aes128-ctr'deBUG1: kex: server->clIEnt aes128-ctr hmac-md5 nonedeBUG2: mac_setup: found hmac-md5deBUG1: REQUESTED ENC.name is 'aes128-ctr'deBUG1: kex: clIEnt->server aes128-ctr hmac-md5 nonedeBUG1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdeBUG1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdeBUG2: dh_gen_key: priv key bits set: 138/256deBUG2: bits set: 514/1024deBUG1: SSH2_MSG_KEX_DH_GEX_INIT sentdeBUG1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdeBUG1: Server host key: RSA a1:28:fd:35:98:19:ee:73:19:a8:de:1d:20:33:b6:6ddeBUG3: load_hostkeys: loading entrIEs for host "server.com" from file "/home/alanhaggai/.ssh/kNown_hosts"deBUG3: load_hostkeys: found key type RSA in file /home/alanhaggai/.ssh/kNown_hosts:1deBUG3: load_hostkeys: loaded 1 keysdeBUG3: load_hostkeys: loading entrIEs for host "111.222.111.222" from file "/home/alanhaggai/.ssh/kNown_hosts"deBUG3: load_hostkeys: found key type RSA in file /home/alanhaggai/.ssh/kNown_hosts:1deBUG3: load_hostkeys: loaded 1 keysdeBUG1: Host 'server.com' is kNown and matches the RSA host key.deBUG1: Found key in /home/alanhaggai/.ssh/kNown_hosts:1deBUG2: bits set: 525/1024deBUG1: ssh_rsa_verify: signature correctdeBUG2: kex_derive_keysdeBUG2: set_newkeys: mode 1deBUG1: SSH2_MSG_NEWKEYS sentdeBUG1: expecting SSH2_MSG_NEWKEYSdeBUG2: set_newkeys: mode 0deBUG1: SSH2_MSG_NEWKEYS receiveddeBUG1: Roaming not allowed by serverdeBUG1: SSH2_MSG_SERVICE_REQUEST sentdeBUG2: service_accept: ssh-userauthdeBUG1: SSH2_MSG_SERVICE_ACCEPT receiveddeBUG2: key: /home/alanhaggai/.ssh/ID_rsa (0x6813f0)deBUG2: key: /home/alanhaggai/.ssh/ID_dsa ((nil))deBUG2: key: /home/alanhaggai/.ssh/ID_ecdsa ((nil))deBUG1: Authentications that can continue: publickey,passworddeBUG3: start over,passed a different List publickey,passworddeBUG3: preferred publickey,keyboard-interactive,passworddeBUG3: authmethod_lookup publickeydeBUG3: remaining preferred: keyboard-interactive,passworddeBUG3: authmethod_is_enabled publickeydeBUG1: Next authentication method: publickeydeBUG1: Offering RSA public key: /home/alanhaggai/.ssh/ID_rsadeBUG3: send_pubkey_testdeBUG2: we sent a publickey packet,wait for replydeBUG1: Server accepts key: pkalg ssh-rsa blen 277deBUG2: input_userauth_pk_ok: fp db:e7:33:bd:a8:1e:ae:fa:3b:3d:85:da:c0:9f:4a:6ddeBUG3: sign_and_send_pubkey: RSA db:e7:33:bd:a8:1e:ae:fa:3b:3d:85:da:c0:9f:4a:6ddeBUG1: read PEM private key done: type RSAdeBUG1: Authentication succeeded (publickey).Authenticated to server.com ([111.222.111.222]:22).deBUG2: fd 4 setting O_NONBLOCKdeBUG2: fd 5 setting O_NONBLOCKdeBUG1: HPN to Non-HPN ConnectiondeBUG1: Final hpn_buffer_size = 2097152deBUG1: HPN Disabled: 0,HPN Buffer Size: 2097152deBUG1: channel 0: new [clIEnt-session]deBUG1: Enabled Dynamic Window ScalingdeBUG3: ssh_session2_open: channel_new: 0deBUG2: channel 0: send opendeBUG1: Requesting no-more-sessions@openssh.comdeBUG1: Entering interactive session.deBUG2: callback startdeBUG2: clIEnt_session2_setup: ID 0deBUG2: fd 3 setting TCP_NODELAYdeBUG3: packet_set_tos: set IP_TOS 0x08deBUG1: Sending command: scp -v -t -- /tmpdeBUG2: channel 0: request exec confirm 1deBUG2: callback donedeBUG2: channel 0: open confirm rwindow 0 rmax 32768deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: channel 0: rcvd adjust 2097152deBUG2: channel_input_status_confirm: type 99 ID 0deBUG2: exec request accepted on channel 0deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3Sending file modes: C0644 10899 foo.bardeBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: channel 0: rcvd ext data 30deBUG2: tcpwinsz: 87380 for connection: 3Sink: C0644 10899 foo.bardeBUG2: channel 0: written 30 to efd 6deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3foo.bar                                                                                                                 100%   11KB  10.6KB/s  10.6KB/s   00:00    deBUG2: tcpwinsz: 87380 for connection: 3deBUG2: tcpwinsz: 87380 for connection: 3

过了一会儿:

^ C(中断)

deBUG1: channel 0: free: clIEnt-session,nchannels 1deBUG3: channel 0: status: The following connections are open:  #0 clIEnt-session (t4 r0 i0/0 o0/0 fd 4/5 cc -1)deBUG1: fd 0 clearing O_NONBLOCKdeBUG1: fd 1 clearing O_NONBLOCKKilled by signal 2.

的/ etc / SSH / sshd_config中

# Package generated configuration file# See the sshd_config(5) manpage for details# What ports,IPs and protocols we Listen forPort 22# Use these options to restrict which interfaces/protocols sshd will bind to#ListenAddress ::#ListenAddress 0.0.0.0Protocol 2# HostKeys for protocol version 2HostKey /etc/ssh/ssh_host_rsa_keyHostKey /etc/ssh/ssh_host_dsa_key#Privilege Separation is turned on for securityUsePrivilegeSeparation yes# lifetime and size of ephemeral version 1 server keyKeyRegenerationInterval 3600ServerKeyBits 768# LoggingSyslogFacility AUTHLogLevel INFO# Authentication:LoginGraceTime 120PermitRootLogin yesStrictModes yesRSAAuthentication yesPubkeyAuthentication yes#AuthorizedKeysfile     %h/.ssh/authorized_keys# Don't read the user's ~/.rhosts and ~/.shosts filesIgnoreRhosts yes# For this to work you will also need host keys in /etc/ssh_kNown_hostsRhostsRSAAuthentication no# similar for protocol version 2HostbasedAuthentication no# Uncomment if you don't trust ~/.ssh/kNown_hosts for RhostsRSAAuthentication#IgnoreUserKNownHosts yes# To enable empty passwords,change to yes (NOT RECOMMENDED)PermitEmptyPasswords no# Change to yes to enable challenge-response passwords (beware issues with# some PAM modules and threads)ChallengeResponseAuthentication no# Change to no to disable tunnelled clear text passwords#PasswordAuthentication yes# Kerberos options#KerberosAuthentication no#KerberosGetAFSToken no#KerberosOrLocalPasswd yes#KerberosTicketCleanup yes# GSSAPI options#GSSAPIAuthentication no#GSSAPICleanupCredentials yesX11Forwarding yesX11displayOffset 10PrintMotd noPrintLastLog yesTCPKeepAlive yes#UseLogin no#MaxStartups 10:30:60#Banner /etc/issue.net# Allow clIEnt to pass locale environment variablesAcceptEnv LANG LC_*Subsystem sftp /usr/lib/openssh/sftp-server# Set this to 'yes' to enable PAM authentication,account processing,# and session processing. If this is enabled,PAM authentication will# be allowed through the ChallengeResponseAuthentication and# PasswordAuthentication.  Depending on your PAM configuration,# PAM authentication via ChallengeResponseAuthentication may bypass# the setting of "PermitRootLogin without-password".# If you just want the PAM account and session checks to run without# PAM authentication,then enable this but set PasswordAuthentication# and ChallengeResponseAuthentication to 'no'.UsePAM yes

推理:不是客户端问题,因为scp和rsync可以与其他服务器一起正常工作

采取的步骤

> OpenSSH服务器已被删除,清除并重新安装
> .ssh /和其中文件的调整权限

解决方法 我怀疑行为不端的服务器在〜/ .bashrc,〜/ .profile或其他启动脚本中有一些不寻常的东西.每次我看到类似的行为,都会在.bashrc或类似的东西上有一些自动运行软件. 总结

以上是内存溢出为你收集整理的scp和rsync不起作用(ssh工作)全部内容,希望文章能够帮你解决scp和rsync不起作用(ssh工作)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1040705.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存