In your sshd_config did you identify the users who are allowed to connect?
# Authentication:
Allowusers testuser
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am using Windows 10 as source computer and nd Windows 11 as destination computer.
I am getting permissions denied error even I am sure that password I am using is correct.
scp -r director-on-local-machine username@machine-ip:path-to-directory
Permission denied, please try again:
Afterwards, modified the ssh file with changes as shown in the below figure:
In your sshd_config did you identify the users who are allowed to connect?
# Authentication:
Allowusers testuser
i just ran some tests and that Pubkey statement is not the problem. I was not able to login with my admin account, so I had to comment out the AllowUsers because it was only letting my testuser in.
Add these 2 lines to your config.
SyslogFacility LOCAL0
LogLevel Debug1
Then recycle the sshd service and try to log in again. Check for errors in the C:\ProgramData\ssh\logs\sshd.log file.
Here is my sshd_config file. (Update; I used Filezilla and connected via SFTP.)
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
# Local0 is the log folder
SyslogFacility LOCAL0
LogLevel Debug1
# Authentication:
#Allowusers testuser
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no
# GSSAPI options
#GSSAPIAuthentication no
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp sftp-server.exe
# Example of overriding settings on a per-user basis
#Match User anoncvs
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Match user testuser
ChrootDirectory c:/temp
even I am sure that password I am using is correct
Check the Security eventlog for logon errors.
Check the OpenSSH server logs for errors.
https://github.com/PowerShell/Win32-OpenSSH/wiki/Logging-Facilities
Before trying to use scp, try logging on to the remote machine using ssh. If ssh doesn't work there's is no hope of scp succeeding.
Are the machines in a workgroup or a domain?
Have some issues to upload screenshots, that's why using this section to upload.