Versuch, eine einfache TXT-Datei (bald CSV-Dateien) von Windows Server 2019 mit dem Befehl scp (oder sftp oder ssh) an einen Remote-Server zu senden. Der Mitarbeiter des Remote-Servers hat uns einen Benutzernamen und ein Passwort zur Anmeldung gegeben. WinSCP funktioniert einwandfrei. Unser Sicherheitsteam möchte, dass wir WinSCP nicht verwenden, sondern es mit ssh automatisieren (wofür sie derzeit versuchen, eine Möglichkeit mit scp zu finden).
Erster Befehl (Port redigiert):
scp -v -P ***** Test.txt username@remoteserveraddress:/
Ausgabe hier:
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
Antwort1
debug1: Remote protocol version 2.0, remote software version Serv-U_15.3.1.155
Dieser Zeile zufolge verbinden Sie sich offenbar mit einem Serverprodukt namens„Serv-U“ von Solarwinds.
Entsprechenddiese Seite, Serv-U unterstützt das SCP-Protokoll nicht. Sie müssen auf den Server über einen seinerUnterstützte Protokolle. Für SSH-basierte Dateiübertragungen unterstützt es anscheinend SFTP.