Disconnected: Unable to authenticate
Hi.
I want to connect to server with scp protocol and I can do this by WinScp.exe.
But c# code does not work =(
username = "root" and there's no password
Here's my code:
Here is SessionLog
I tried to set password as empty string in SessionOptions - does not work.
Please tell me how to connect with "root" and no password.
I say again - I can connect with WinScp.exe
I want to connect to server with scp protocol and I can do this by WinScp.exe.
But c# code does not work =(
username = "root" and there's no password
Here's my code:
// Setup session options var sessionOptions = new SessionOptions { Protocol = Protocol.Scp, HostName = "10.0.6.10", UserName = "root", GiveUpSecurityAndAcceptAnySshHostKey = true, }; using (var session = new Session() { SessionLogPath = Path.GetFullPath(@".\WinScpSessionLog.txt"), DebugLogPath = Path.GetFullPath(@".\WinScpDebugLog.txt") }) { // Connect session.Open(sessionOptions); }
Here is SessionLog
. 2015-02-03 11:50:25.854 -------------------------------------------------------------------------- . 2015-02-03 11:50:25.854 Script: Retrospectively logging previous script records: > 2015-02-03 11:50:25.854 Script: option batch on < 2015-02-03 11:50:25.854 Script: batch on > 2015-02-03 11:50:25.854 Script: option confirm off < 2015-02-03 11:50:25.854 Script: confirm off > 2015-02-03 11:50:25.854 Script: open -hostkey="*" -timeout=15 "scp://root@10.0.6.10" . 2015-02-03 11:50:25.854 -------------------------------------------------------------------------- . 2015-02-03 11:50:25.854 Session name: root@10.0.6.10 (Ad-Hoc site) . 2015-02-03 11:50:25.854 Host name: 10.0.6.10 (Port: 22) . 2015-02-03 11:50:25.854 User name: root (Password: No, Key file: No) . 2015-02-03 11:50:25.854 Tunnel: No . 2015-02-03 11:50:25.854 Transfer Protocol: SCP . 2015-02-03 11:50:25.854 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec . 2015-02-03 11:50:25.854 Proxy: none . 2015-02-03 11:50:25.854 Send buffer: 262144 . 2015-02-03 11:50:25.854 SSH protocol version: 2; Compression: No . 2015-02-03 11:50:25.854 Bypass authentication: No . 2015-02-03 11:50:25.854 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No . 2015-02-03 11:50:25.854 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No . 2015-02-03 11:50:25.854 SSH Bugs: A,A,A,A,A,A,A,A,A,A . 2015-02-03 11:50:25.854 Simple channel: Yes . 2015-02-03 11:50:25.854 Return code variable: Autodetect; Lookup user groups: A . 2015-02-03 11:50:25.854 Shell: default . 2015-02-03 11:50:25.854 EOL: 0, UTF: 2 . 2015-02-03 11:50:25.854 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes . 2015-02-03 11:50:25.854 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No . 2015-02-03 11:50:25.854 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes . 2015-02-03 11:50:25.854 Cache directory changes: Yes, Permanent: Yes . 2015-02-03 11:50:25.854 DST mode: 1; Timezone offset: 0h 0m . 2015-02-03 11:50:25.855 -------------------------------------------------------------------------- . 2015-02-03 11:50:25.855 Looking up host "10.0.6.10" . 2015-02-03 11:50:25.855 Connecting to 10.0.6.10 port 22 . 2015-02-03 11:50:25.877 Server version: SSH-2.0-dropbear_2012.55 . 2015-02-03 11:50:25.877 Using SSH protocol version 2 . 2015-02-03 11:50:25.877 We claim version: SSH-2.0-WinSCP_release_5.5.6 . 2015-02-03 11:50:25.882 Using Diffie-Hellman with standard group "group14" . 2015-02-03 11:50:25.882 Doing Diffie-Hellman key exchange with hash SHA-1 . 2015-02-03 11:50:28.768 Verifying host key rsa2 0x10001,0xa7a19cd551c55d45 3d7bddcbe8e15343 b9d33bf2b647c3a2 9380a965ecb3b40f ed998cb4d2563515 062696665a1bbb6f d203e6fabaca4854 efaaddf00112b585 4dbfc27fde82b0f6 3b748cbfc0ccb0c1 761204ea860e9f92 01feba85cf57a17c f621203982649abb c0be6943518ad249 9ab7a757098f5c0a e26598411119fa6e 326f with fingerprint ssh-rsa 1040 7e:0c:fc:2d:0d:a9:36:b9:1f:c5:e1:12:29:5b:8e:3d * 2015-02-03 11:50:28.769 WARNING! Giving up security and accepting any key as configured! . 2015-02-03 11:50:28.769 Host key fingerprint is: . 2015-02-03 11:50:28.769 ssh-rsa 1040 7e:0c:fc:2d:0d:a9:36:b9:1f:c5:e1:12:29:5b:8e:3d . 2015-02-03 11:50:28.769 Initialised AES-256 SDCTR client->server encryption . 2015-02-03 11:50:28.769 Initialised HMAC-SHA1 client->server MAC algorithm . 2015-02-03 11:50:28.769 Initialised AES-256 SDCTR server->client encryption . 2015-02-03 11:50:28.769 Initialised HMAC-SHA1 server->client MAC algorithm ! 2015-02-03 11:50:28.775 Using username "root". . 2015-02-03 11:50:28.776 Prompt (7, SSH password, , &Password: ) . 2015-02-03 11:50:28.776 Disconnected: Unable to authenticate
I tried to set password as empty string in SessionOptions - does not work.
Please tell me how to connect with "root" and no password.
I say again - I can connect with WinScp.exe