Help setting up SSH keys with Windows 10 VM

Status
Not open for further replies.

Zaaphod

Contributor
Joined
Dec 15, 2015
Messages
109
I'm having great difficulty setting up ssh to work. I don't understand what I'm doing wrong, but what should have taken a few mintues has taken me 2 days straight and I am still going around in circles. I'm trying to use ssh keys to send an ssh command from FreeNAS to my windows 10 professional VM. Here is what I have done so far:
I have enabled SSH on the windows 10 VM and I can access it with username and password from the FreeNAS shell.
I generated an RSA key with putty on the windows 10 VM
I've edited the public key to remove the extra lines and linefeeds that putty put in so it's all on one line
I went to FreeNAS web interface and opened up a command shell and logged in with an administrator account with all permissions
I used FTP to transfer the key.pub file to the admistrator home directory

trying to follow directions here: http://sshkeychain.sourceforge.net/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO-4.html I did the following:
Code:
mkdir.ssh
touch authorized_keys2
chmod 600 authorized_keys2	   <---- this always fails and I have tried everything to get it not to... I made sure I had it set as unix permissions tried all kinds of variations with sudo and root access...no matter what I do, I get operation not permitted. 
cat ../id_dsa.pub >> authorized_keys2
rm ../id_dsa.pub

It creates authorized_keys2 and known_hosts which seem to be ok.

When I try to connect however it still asks for a password.

Here is what I get:
Code:
Administrator@FreeNas:~ % ssh QB_Server@192.168.0.234 -v
OpenSSH_7.2p2, OpenSSL 1.0.2k-freebsd  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 3: Deprecated option "useroaming"
debug1: Connecting to 192.168.0.234 [192.168.0.234] port 22.
debug1: Connection established.
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_rsa type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_rsa-cert type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_dsa type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_dsa-cert type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_ecdsa type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_ecdsa-cert type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_ed25519 type -1
debug1: Fssh_key_load_public: No such file or directory
debug1: identity file /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2 FreeBSD-20161230
debug1: Remote protocol version 2.0, remote software version MS_1.100
debug1: no match: MS_1.100
debug1: Authenticating to 192.168.0.234:22 as 'QB_Server'
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:jsA6wrtC0WizPUFFN7cFR/s/tHpMG3hJF6gJT5OtQg8
debug1: skipped DNS lookup for numerical hostname
debug1: Host '192.168.0.234' is known and matches the RSA host key.
debug1: Found key in /mnt/Dataset_4TB/4TB/User Datasets/Administrator/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi-with-mic,password
debug1: Next authentication method: password
QB_Server@192.168.0.234's password:

I'm hoping someone can tell me what I am doing wrong. I have NO experience with this at all... I just want to run a script to shutdown the Windows 10 VM when FreeNAS shuts down. At this point I don't even care if the password is in the script.. I just want to get it to work so if there is a power failure it won't crash my windows 10 VM... it will do a proper shutdown instead any advice is greatly appreciated!
 
Last edited by a moderator:
D

dlavigne

Guest
Were you able to resolve this? If not, how did you add the public key to the FreeNAS system?
 
Status
Not open for further replies.
Top