Questions tagged [openssh]

A free and open implementation of the SSH communication security tools.

Filter by
Sorted by
Tagged with
0 votes
3 answers
79 views

Is it possible to retrieve the public-key from an encrypted or passphrase-protected ssh private-key?

I have created an open-ssh keypair using ssh-keygen with the defaults, and encrypted the private key with a passphrase. I already know how to derive the public-key from the private-key using ssh-...
  • 21
1 vote
2 answers
106 views

SSH XMSS keypair generation and best practices

In a recent ssh -vv output, I saw OpenSSH mentioning a private key file id_xmss. XMSS is defined in RFC 8391, "XMSS: eXtended Merkle Signature Scheme", May 2018. OpenSSH has experimental ...
  • 2,695
19 votes
1 answer
5k views

Why did OpenSSH create its own key format, and not use PKCS#8?

Before posting this question about ed25519, I learned that there are two formats for storing a private ed25519 key, PKCS#8 OpenSSH Format Why did OpenSSH create its own format rather than use PKCS#8?...
  • 2,579
4 votes
3 answers
794 views

How can I convert an ED25519 key in PKCS#8 to OpenSSH private key format?

I'm having a problem where when I export a key from 1password, and use it with ssh -i, I get Load key "/home/user/.ssh/private_ed25519": invalid format Doing a google search on this, it ...
  • 2,579
1 vote
0 answers
198 views

Reading SSH private key physically stored on yubikey to remote into external PC

I was wondering if it's possible to only store and read a ssh private key on a yubikey and not read the private key the yubikey generated from a client computer? Currently the only way it seems to ...
1 vote
0 answers
66 views

SSH authentication with GPG failing with a new Yubikey with the same gpg keys as the old one

I have a MacBook M1 on which I have been using a Yubikey 5 to authenticate SSH logins to various systems. I recently got a Yubikey 5C so I wouldn't have to use adapters. I moved my keys over to it ...
0 votes
1 answer
44 views

Does the ssh client compute the public key from the private key?

If I use ssh like this ssh -i id_rsa it means im passing the private key to ssh. Does ssh now then compute the public key from it and then send it to the server? Then the server would look if the ...
0 votes
1 answer
150 views

When hardening my SSH key, why would I use yubikey-agent instead of the built-in `-sk` key type native to OpenSSH?

OpenSSH 8.2 added -sk key types that allow for FIDO/U2F hardware authenticators (like a YubiKey, etc.) yubikey-agent allows for the same functionality, except it (a) requires an additional client on ...
1 vote
0 answers
1k views

How to extract a RSA private key from an ssh-agent core dump

I need to extract an RSA private key from an ssh-agent core dump running on ubuntu 20.04. I believe the ssh version is the latest. I have tried many Linux tools with no luck. I also wrote a python ...
2 votes
2 answers
2k views

OpenSSH Disabling Diffie-Hellman (DHE) key exchange

I'm seeking to mitigate CVE-2002-20001 by disabling DHE key exchange through OpenSSH on an Ubuntu instance. I understand this can be achieved through editing the /etc/ssh/sshd_config at line ...
0 votes
0 answers
53 views

Securing SSH reverse proxy from app in an untrusted environment to server

I'm adding a feature to my web app that will allow remote configuration of various devices via their built-in web apps. For forwarding the HTTP traffic from my web app to the remote device I'm ...
  • 101
3 votes
1 answer
256 views

SSH strict "pubkey with a password" required for login?

Did i misunderstand from this post? RequiredAuthentications2 | Usually this is done to require pubkey and 2-factor authentication token, not the user's password. you can use RequiredAuthentications2 ...
1 vote
2 answers
166 views

Cannot use "ecdsa" and "rsa" in parallel when using SFTP

When I connect to my "OpenSSH_8.2p1 Ubuntu-4ubuntu0.4" server alternating using sftp -v -o HostKeyAlgorithms=ecdsa-sha2-nistp256 test-user@localhost and sftp -v -o HostKeyAlgorithms=rsa-sha2-...
3 votes
1 answer
1k views

ssh-keygen fingerprint format is different between RSA+ECDSA and ED25519

I noticed that when showing the fingerprint of different key types, there is one difference in the format. for some reason ED25519 has the hash bits (I guess?) - 256, whereas the other key types have ...
  • 141
1 vote
1 answer
386 views

How can ssh-keygen be used to update /etc/ssh/moduli?

I have some machines whose primes in /etc/ssh/moduli are now considered too weak because they are less than 2048 bits. There are a couple questions on this site concerning the consequences of updating ...
  • 113
0 votes
3 answers
1k views

Why are FIDO2 protected SSH keys affected by phishing attacks?

The OpenSSH developers have written in a description of the "agent restrictions" feature that FIDO2 tokens are vulnerable to phishing attacks: https://www.openssh.com/agent-restrict.html ...
1 vote
1 answer
110 views

ssh server encrypted key vs password login [duplicate]

In an openssh-server login to a GNU/Linux machine to use a private ssh key encrypted with an N-characters passphrase, then sshd_config: PasswordAuthentication no PubkeyAuthentication yes is it ...
  • 121
0 votes
3 answers
409 views

Best practices for securing SSH access? Is certificate-based VPN server a good solution?

I run a server on a hosting. I want to harden it, but ssh access is giving me a bit of concerns. I usually access from home most of the times. I have a provider subscription with the usual DHCP setup ...
2 votes
1 answer
92 views

OpenSSH Primes - can there be such a thing as "too few" primes available?

The (old) Secure Secure Shell guide suggests (re)creating /etc/ssh/moduli so sshd has safe prime numbers to use for Diffie-Hellman key agreement. I've generated a 4096-bit moduli file with ssh-keygen -...
2 votes
0 answers
151 views

Is it possible to regenerate the stub private key from just the physical key in OpenSSH?

Let's say I make an id of type ed25519-sk and have it reside on my yubikey. OpenSSH makes two files, id_ed25519_sk, a stub private key, and id_ed25519_sk.pub the corresponding public key. If I lose ...
  • 121
1 vote
0 answers
118 views

Is it possible to use an ed25519 security key with Google Chrome SSH applets?

After generating an OpenSSH EC key on a hardware security key: $ ssh-keygen -t ed25519-sk -C comment Is it possible to use this key with Google Chrome SSH applet or Mosh, in particular on non-Linux ...
  • 507
7 votes
1 answer
198 views

How sensitive is the primary key stub of an ed25519 security key (~/.ssh/id_ed25519_sk)?

Now that OpenSSH supports Elliptic curve security keys (since version 8.2), it's possible to generate a ed25519-sk key on a hardware security key: $ ssh-keygen -t ed25519-sk -C comment This generates ...
  • 507
1 vote
1 answer
213 views

SSH to github.com only adds RSA keys - excludes ed25519 host keys

I am doing some tests around ssh. From what I have seen a server usually has multiple host keys. When a client tries to connect, it tries to negotiate which key types to use DSA, RSA, ECDSA, etc. But ...
1 vote
1 answer
167 views

Are there any known SSH (protocol or implementation) vulnerabilities which can be performed on a tor hidden service?

The last couple of weeks I have been researching possible attacks that can be performed on a Tor hidden service using SSH from a location different from that of the server, assuming the .onion address ...
1 vote
2 answers
525 views

What are possible implications of ignoring the ssh host key warning?

With password authentication you're basically giving your password to the attacker. At least that is my understanding. What about public key authentication? I hear that a private key never leaves your ...
  • 267
5 votes
1 answer
13k views

Why are rsa-sha2-512 and rsa-sha2-256 supported but not reported by ssh -Q key?

Running on macOS, I see these available key algorithms: $ ssh -V OpenSSH_8.1p1, LibreSSL 2.7.3 $ ssh -Q key ssh-ed25519 ssh-ed25519-cert-v01@openssh.com ssh-rsa ssh-dss ecdsa-sha2-nistp256 ecdsa-sha2-...
1 vote
1 answer
2k views

OpenSSH AuthorizedPrincipalsFile Allows Any User

I am bewildered as to the below config and subsequent behaviour. /etc/ssh/sshd_config: AuthorizedPrincipalsFile /etc/ssh/principals /etc/ssh/principals: all host.example.com dev This allows me to ...
7 votes
1 answer
3k views

How does ed25519-sk actually works?

My google-foo failed me as most "how it works" sections related to fido are very... let's say... consumer-oriented. So openssh supports U2F natively when using the appropriate elliptic-curve-...
  • 73
5 votes
1 answer
727 views

Is getting server host key with ssh-keyscan secure?

I am trying to establish SSH connection to a server through a program. As a pre-requisite to be able to do so, I am getting the publicly available server host key using ssh-keyscan <hostname> ...
  • 153
3 votes
1 answer
797 views

ssh -Q key not listing all key types?

I am having some problems with understanding which types of host keys my SSH daemon actually provides or supports (stock debian buster, sshd 7.9.p1). From the manual (man sshd_config): ...
  • 557
1 vote
0 answers
98 views

How to interpret received packets, although not being destination host

Set up: Victim: 192.168.0.2 Attacker (also having SSH server installed): 192.168.0.3 SSH server: 192.168.0.4 I perform a successful ARP Spoofing attack (being obviously the attacker's MAC address): ...
-2 votes
2 answers
1k views

Why should we only keep the private key secret, why not the public key? [duplicate]

If I am not wrong, both private key and public key are the same since communication is possible only if both keys are matching. So, why we should only keep the private key secret, why not public key? ...
  • 33
2 votes
1 answer
424 views

ssh-keygen: How to guarantee the uniqueness of serial numbers?

(FYI: I'm using Ubuntu 18.04 Desktop although I don't think my question is platform-dependent.) I read the article Scalable and secure access with SSH and it says: ... if you want to use revocation ...
  • 141
1 vote
0 answers
43 views

SSH Public Key Authentication Strength Port 22 [duplicate]

Let’s say I have a server with Port 22 opened to the internet , password authentication disabled, and root remote login disabled. Only Key Authentication is enabled. If the key is tightly secured, is ...
1 vote
1 answer
772 views

How to convert 64byte openssh-key-v1 to the resulting 32byte ed25519 private key

I wrote an openssh-key-v1 Protocol reader and extracted all fields according to the format definition: "openssh-key-v1"0x00 # NULL-terminated "Auth Magic" string 32-bit length,...
0 votes
1 answer
1k views

How hacker/ others get your SSH private key / stole your SSH private key?

I know we must keep private keys secure, but as long as we don't share the private key, what can go wrong? How hackers/others can steal/get your private key? What is the possible way that can happen ...
1 vote
1 answer
160 views

Efficiently handling malicious, single connection attempts to a server?

I wanted to know what efficient way is there to handle malicious attempts to connect to my server by single IPs. The attempts show up logged in /var/log/auth.log as Connection closed by IPaddress port ...
  • 145
0 votes
0 answers
54 views

OpenSSH artifacts, remote system access? [duplicate]

After stumbling upon some unknown folders in my unused OneDrive (posted question), I did some digging arround and found some interesting logs. Apparently, OpenSSH had been used for remote access on my ...
  • 101
0 votes
1 answer
336 views

Recommendations on minimal alternatives to openssh [closed]

Although openssh is awesome, I'm interested in exploring some more lightweight FLOSS alternatives to use for connecting to servers I'm administrating (and using alone). Since I only need a minimal ...
  • 121
5 votes
3 answers
2k views

How does the weakness of SHA-1 introduce attack vectors in SSH?

The security branch of my company worries that the use of older versions of OpenSSH (pre-7.4), where the only Key Exchange Algorithm available is SHA-1 is a major security issue. They suggest ...
  • 53
3 votes
0 answers
831 views

GPG Agent SSH Forward Pinentry

I have GPG agent forwarding via SSH RemoteForward working up to a point. I can list my private and public keys on the remote host. If I try to decrypt a file remotely, the PIN is prompted for but the ...
1 vote
2 answers
2k views

OpenSSH: Meaning of cipher with email address @openssh.com

When using OpenSSH server (sshd) we specify allowed ciphers, host key algorithms and MACs. Some of those ciphers have an email address appended, for example aes256-gcm@openssh.com as opposed to aes256-...
  • 113
1 vote
0 answers
90 views

Risk of committing IdentityFile name for OpenSSH configuration to public repository

What is the risk of committing the IdentityFile line for each of my Host entries in my ~/.ssh/config to my public dotfiles repository? Would providing such information make it any easier for an ...
  • 290
4 votes
1 answer
498 views

Benefit of using OpenSSH FIDO/U2F support over GPG mode?

OpenSSH version 8.2 introduced support for FIDO/U2F hardware authenticators, via the new public key types "ecdsa-sk" and "ed25519-sk". I currently have SSH authentication set up in combination with ...
  • 141
23 votes
2 answers
18k views

OpenSSH declares ssh-rsa deprecated. What do I do next?

With the 8.2 release of OpenSSH, they have declared that ssh-rsa for SHA-1 will soon be removed from the defaults: Future deprecation notice It is now possible[1] to perform chosen-prefix ...
  • 2,462
0 votes
0 answers
2k views

Interpreting SSH information on Windows Event Viewer.... sshd: Did not receive identification string from ipaddress on port portnumber

I am currently reading through Windows Event Log (OpenSSH) looking at the artefacts created by an attack, I am trying to understand the meaning of certain notifications. A brute force attack was ...
  • 73
11 votes
1 answer
2k views

Does it weaken the encryption of SSH to use compression?

When using compression on openssh (a la ssh -C ...), does this reduce entropy and make the tunnel traffic more vulnerable to cryptanalysis? Is compression an option I should disable server-side for ...
1 vote
1 answer
375 views

SSH and the ECDH component

With SSH, most of my servers use ed25519 (the twisted Edwards variant EC) for authentication. I was wondering, after authentication with ed25519, does SSH protocol 2 simple use ephemeral/ephemeral ...
  • 689
6 votes
2 answers
5k views

How to accept only user identity keys of type ed25519 on OpenSSH Linux server?

I want to force all users to use only ed25519 type keys when logging in via SSH / SFTP to a Linux server which is running a recent version* of OpenSSH. Some general reasons for putting controls on SSH ...
  • 340
6 votes
2 answers
617 views

Does `ssh-keyscan` verify the legitimacy of the host(s) it scans?

There are tutorials on the web, such as this one: https://blog.oddbit.com/post/2019-02-24-docker-build-learns-about-secr/ They show you sample code to run ssh-keyscan in an automated manner so that ...
  • 267