SSH w/Keys: Win10 Client. Key Refused.
Posted: Sun Jan 31, 2016 5:30 am
I pulled my RasPI out of storage today and have been trying to get it working again (I had it working a few years ago but had put it in storage for the past year or so). After starting it up today, I ran apt-get update and apt-get upgrade to be sure it had all the latest patches.
Anyway....... When attempting to connect my laptop (purchased since the last time the RasPi was in service and has Win10) via SSH, it keeps telling me that it refused the key.
I used PuttyGen to generate a public/private key pair (RSA), copied the contents of the OpenSSH field into ~/.ssh/authorized_keys. I saved both the public key and the private key files on my laptop (not encrypted for now). Then I set Putty to use the private key file.
This is the contents of my authorized_keys file (yes it's all one line -- the website word-wrapped it):
This is my /etc/ssh/sshd_config file:
Anyway....... When attempting to connect my laptop (purchased since the last time the RasPi was in service and has Win10) via SSH, it keeps telling me that it refused the key.
I used PuttyGen to generate a public/private key pair (RSA), copied the contents of the OpenSSH field into ~/.ssh/authorized_keys. I saved both the public key and the private key files on my laptop (not encrypted for now). Then I set Putty to use the private key file.
This is the contents of my authorized_keys file (yes it's all one line -- the website word-wrapped it):
Code: Select all
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAgEAp+G18QqhzVZ4onsgyucI7iT+/9mGbVXYdP+M4TSTZV+iwp8p7mJx0Fv3DYdxDTRAr0/aEvoj+N8LFxaTcHO7quonq/rM6NQA3hyABMvMpDUZ8/bBmVYKxNdcZJ90hN7tRWP0X7OXUjuZlhcctCjsVc5INvLt1sDNwsAXpFbGtpkEF7pk+hAXnkxM9h28rFZVyqIk0vYlXJNjQJ/USPyfl6YpLBWswWeWOZ40GLwHOEFJBbtweNEh4WhogSLxDKmTkq3aZycWhGErAbRaNLHYVXSyxIBtY1ln9FyNEfny4vfB2g7bMTeQ1VqZXcV31Jl0x9jYb3+R6zaOCcNZgmwHY4hG4CAi8lk48XLsloIlgNgkkkWqZ7jME3YpuCuE8Fi3qMcafSgThPLpCi7mvAqMCjM4mktILE7s+/bh7Lc+39J5k8fNvJDPTbqyFfquJqZEDGCCFdCeneJymqNkZZnTExVQrp7vkyPSXwwjVhYAnYrRc7Hno8jtKkWZTyiZPGwscpfqUBdz4BSHdoFYUvBEpSheVdfr4/mtr3aUwYyLJQp/pwQZe7v6yMwX4TfZRo6l9bKHaboUvOUp9SidnklPfW6CoBn8X8O3Nl4WCk+0K9w9tj55qOw6XNFL5YHrI2odL8efd0CMhZZkNV6QVRpYo6lZwUUbu2iAZnIe/tPHSXU= rsa-key-20160130
This is my /etc/ssh/sshd_config file:
Code: Select all
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
#Port 22
Port 9922
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
#PermitRootLogin yes
StrictModes yes
#RSAAuthentication yes
#PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
# RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication 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 yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv 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 no
PermitRootLogin no
AllowUsers pi
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#PasswordAuthentication yes