보내는 명령: scp -v -t / exec 요청이 채널 0에서 실패했습니다.

보내는 명령: scp -v -t / exec 요청이 채널 0에서 실패했습니다.

scp 명령(또는 sftp 또는 ssh)을 사용하여 Windows Server 2019에서 간단한 txt 파일(곧 csv 파일이 될 예정)을 원격 서버로 보내려고 합니다. 원격 서버 직원이 로그인에 사용할 사용자 이름과 비밀번호를 제공했습니다. WinSCP는 잘 작동합니다. 우리 보안 팀은 WinSCP를 사용하지 않고 ssh(현재 scp를 사용하여 방법을 찾으려고 노력 중)를 사용하여 자동화하기를 원합니다.

초기 명령(포트 수정됨):

scp -v -P ***** Test.txt username@remoteserveraddress:/

여기에 출력:

C:\Users\username>scp -v -P ***** Test.txt username@remoteserveraddress:/
Executing: program ssh.exe host remoteserveraddress, user username, command scp -v -t /
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\username/.ssh/config
debug1: Connecting to remoteserveraddress [remoteserveraddress] port *****.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\username/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
debug1: Remote protocol version 2.0, remote software version Serv-U_15.3.1.155
debug1: no match: Serv-U_15.3.1.155
debug1: Authenticating to remoteserveraddress:***** as 'username'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:superSECRETKEyRedactedForMyProtection:)
debug1: Host '[remoteserveraddress]:*****' is known and matches the RSA host key.
debug1: Found key in C:\\Users\\username/.ssh/known_hosts:1
debug1: rekey after 4******6 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4*******6 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
username@remoteserveraddress's password:
debug1: Authentication succeeded (password).
Authenticated to remoteserveraddress ([remoteserveraddress]:*****).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending command: scp -v -t /
exec request failed on channel 0
lost connection

답변1

debug1: Remote protocol version 2.0, remote software version Serv-U_15.3.1.155

이 줄에 따르면 귀하는 분명히 다음과 같은 서버 제품에 연결하고 있습니다.Solarwinds의 "Serv-U".

에 따르면이 페이지, Serv-U는 SCP 프로토콜을 지원하지 않습니다. 다음 중 하나를 사용하여 서버에 액세스해야 합니다.지원되는 프로토콜. SSH 기반 파일 전송의 경우 SFTP를 지원하는 것으로 보입니다.

관련 정보