[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [SUPPORT REQUEST] Configuration of libssh host key algos on client


Hi Anderson,

thanks for your reply.

I have copied /etc/ssh/sshd_config tot he directory you specified, e.g. as I am root on the client, I put it under /root/.ssh/sshd_config and restarted the service via

service sshd restart

Unfortunately, I get the same error. Maybe it helps you to take a look at the whole config file, which I attached to this email.

Regards, 
Sebastian

-----Ursprüngliche Nachricht-----
Von: Anderson Sasaki <ansasaki@xxxxxxxxxx> 
Gesendet: Montag, 25. Mai 2020 18:37
An: libssh@xxxxxxxxxx
Betreff: Re: [SUPPORT REQUEST] Configuration of libssh host key algos on client

NOTICE: This message originated from outside of the company. Please exercise caution when replying or opening links and attachments.




----- Original Message -----
> From: "Sebastian Kraust" <sebastian.kraust@xxxxxxxxxx>
> To: libssh@xxxxxxxxxx
> Sent: Monday, May 25, 2020 5:52:15 PM
> Subject: [SUPPORT REQUEST] Configuration of libssh host key algos on 
> client
>
> Hello libssh-team,
>
> I am currently working on a project using libssh under the hood, but 
> have problems to get it to work. I hope you can provide some help.
>
> Task
> Write a client for an existing server which cannot be 
> changed/configured by me.
>
> Approach
> Connect to the server using the function `ssh_connect`.
>
> Error
> kex error : no match for method server host key algo: server 
> [ssh-rsa], client 
> [ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp2
> 56,rsa-sha2-512,rsa-sha2-256]
>
> Problem
> Due to the restriction that I can only change the client side, I have 
> to change the client so that it accepts the ssh-rsa algo.
> According to the docs, it should be capable of doing so.
>
> Troubleshooting so far
> Added
> PubkeyAcceptedKeyTypes ssh-ed25519*,ssh-rsa*,ssh-dss*,ecdsa-sha2
> to /etc/ssh/sshd_config to allow every algo on the client side.
>
> I still get the same error. I do believe that the config might not be 
> the correct file to configure libssh.
>
> Can you give me some direction where I have to configure libssh so 
> that the client also accepts the ssh-rsa algorithm? If you need more 
> information, please let me know.

Hello,

Have you tried to add the configuration locally at user's ~/.ssh/config file?

Regards,
Anderson


#	$OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# 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 /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
AuthorizedKeysFile	.ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/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

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# 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 yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#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

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem	sftp	/usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
#	X11Forwarding no
#	AllowTcpForwarding no
#	PermitTTY no
#	ForceCommand cvs server
PubkeyAcceptedKeyTypes ssh-ed25519*,ssh-rsa*,ssh-dss*,ecdsa-sha2*

Follow-Ups:
Re: AW: [SUPPORT REQUEST] Configuration of libssh host key algos on clientAnderson Sasaki <ansasaki@xxxxxxxxxx>
References:
[SUPPORT REQUEST] Configuration of libssh host key algos on clientSebastian Kraust <sebastian.kraust@xxxxxxxxxx>
Re: [SUPPORT REQUEST] Configuration of libssh host key algos on clientAnderson Sasaki <ansasaki@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org