Coder Social home page Coder Social logo

Comments (7)

HsuJv avatar HsuJv commented on May 27, 2024

Hi @MoskalykA ,

Is it okay to show your codes here and provide env info such as the version of ssh-server and target OS.

Also, cloud you provide the log with ssh::is_enable_log(true); on?

BRs.

from ssh-rs.

1148118271 avatar 1148118271 commented on May 27, 2024

You can also check if your server's sshd_config has password login disabled.

vim /etc/ssh/sshd_config
PasswordAuthentication no
PubkeyAuthentication yes

from ssh-rs.

MoskalykA avatar MoskalykA commented on May 27, 2024

/etc/ssh/sshd_config

My code: image

SSH Version: OpenSSH_9.0p1 Ubuntu-1ubuntu7, OpenSSL 3.0.5 5 Jul 2022
OS: Ubuntu 22.10

Logs:

[SSH]-[INFO]: prepare for version negotiation.
[SSH]-[INFO]: server version: [SSH-2.0-OpenSSH_9.0p1 Ubuntu-1ubuntu7]
[SSH]-[INFO]: client version: [SSH-2.0-SSH_RS-0.2.1]
[SSH]-[INFO]: version negotiation was successful.
[SSH]-[INFO]: prepare for key negotiation.
[SSH]-[INFO]: client algorithms: ["curve25519-sha256,ecdh-sha2-nistp256","ssh-ed25519,ssh-rsa","[email protected],aes128-ctr","[email protected],aes128-ctr","hmac-sha1","hmac-sha1","none","none"]
[SSH]-[INFO]: server algorithms: ["[email protected],curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256","rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519","[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]","[email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]","[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1","[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1","none,[email protected]","none,[email protected]"]
[SSH]-[INFO]: signature verification success.
[SSH]-[INFO]: send new keys
[SSH]-[INFO]: key negotiation successful.
[SSH]-[INFO]: public key authentication.
[SSH]-[ERROR]: user auth failure.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error: { Kind(SshError("user auth failure, auth type is password.")), Message(user auth failure, auth type is password.) }', src\main.rs:114:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[SSH]-[TRACE]: returning
[SSH]-[TRACE]: event Readable Token(4194303)
[SSH]-[TRACE]: loop process - 1 events, 0.000s

from ssh-rs.

MoskalykA avatar MoskalykA commented on May 27, 2024

You can also check if your server's sshd_config has password login disabled.

vim /etc/ssh/sshd_config
PasswordAuthentication no
PubkeyAuthentication yes

This does not work

from ssh-rs.

MoskalykA avatar MoskalykA commented on May 27, 2024

However, with these versions, it works:
OS: Ubuntu 20.04.4 LTS
SSH: OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020

from ssh-rs.

HsuJv avatar HsuJv commented on May 27, 2024

Hi @MoskalykA

Please add the following line to your sshd_config and test again

pubkeyacceptedalgorithms ssh-rsa

Or you can add the default algorithm list listed in sshd -T | grep pubkeyacceptedalgorithms

pubkeyacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256

and then append ssh-rsa to this line

BRs.

from ssh-rs.

HsuJv avatar HsuJv commented on May 27, 2024

According to the changlog from OpenSSH 8.7

Imminent deprecation notice
===========================

OpenSSH will disable the ssh-rsa signature scheme by default in the
next release.

from ssh-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.