Debian Generate Ssh Key For User

In Debian Security Advisory 1571,the Debian Security Team disclosed a weakness in the random number generator usedby OpenSSL on Debian and its derivatives. As a result of this weakness,certain encryption keys are much more common than they should be, such that anattacker could guess the key through a brute-force attack given minimal knowledgeof the system. This particularly affects the use of encryption keys in OpenSSH,OpenVPN and SSL certificates.

How To Set Up SSH With Public-Key Authentication On Debian Etch Preliminary Notes. This mini-howto explains how to set up an SSH server on Debian Etch with public-key authorization (and optionally with disabled password logins). SSH is a great tool to control Linux-based computers remotely. If you create your own key pair using a third-party tool, be sure that your key matches the guidelines at Importing Your Own Public Key to Amazon EC2. Add a new user to the EC2 Linux instance. Connect to your Linux instance using SSH. Use the adduser command to add a new user account to an EC2 instance (replace newuser with the new.

Oct 20, 2014 Copying your Public Key Using SSH. If you do not have ssh-copy-id available, but you have password-based SSH access to an account on your server, you can upload your keys using a conventional SSH method. We can do this by outputting the content of our public SSH key on our local computer and piping it through an SSH connection to the remote server. Oct 06, 2019  It is always recommended to set a strong Passphrase for your SSH keys, with at least 15, preferably 20 characters and be difficult to guess. How to Change or update SSH key Passphrase on Linux / Unix. At times you may need to update your SSH key passphrase or set one if you didn’t set at the time of generating your SSH keys. The purpose of ssh-copy-id is to make setting up public key authentication easier. The process is as follows. Generate an SSH Key. With OpenSSH, an SSH key is created using ssh-keygen. In the simplest form, just run ssh-keygen and answer the questions. The following example illustates this. # ssh-keygen Generating public/private rsa key pair.

SiteGround uses key-based authentication for SSH. This has proven more secure over standard username/password authentication. More information on SSH keys can be found here. You can generate an SSH key pair directly in cPanel, or you can generate the keys yourself and just upload the public one in cPanel to use with your hosting account. Dec 18, 2019 In this tutorial, we will describe how to generate SSH keys on Debian 9 systems. We will also show you how to set up an SSH key-based authentication and connect to your remote Linux servers without entering a password. Creating SSH keys on Debian # Before generating a new SSH key pair first, check for existing SSH keys on your Debian client.

This page documents how to perform key rollover procedures for packageswhose keys are affected by the OpenSSL vulnerability.

Other software uses cryptographic keys, but isnot vulnerable as OpenSSL is not used to generateor exchange its keys.

For key rollover instructions for other software, you might want to checkthe user-submitted information in https://wiki.debian.org/SSLkeys

An updated package has been released viaDSA-1576, which eases key transformation.

1. Install the security updates in DSA-1576

Once the update is applied, weak user keys will be automatically rejected where possible (though they cannot be detected in all cases). If you are using such keys for user authentication, they will immediately stop working and will need to be replaced (see step 3).

OpenSSH host keys can be automatically regenerated when the OpenSSH security update is applied. The update will prompt for confirmation before taking this step.

2. Update OpenSSH known_hosts files

The regeneration of host keys will cause a warning to be displayed when connecting to the system using SSH until the host key is updated in the known_hosts file on the client. The warning will look like this:

In this case, the host key has simply been changed, and you should update the relevant known_hosts file as indicated in the warning message. It is recommended that you use a trustworthy channel to exchange the server key. It is found in the file /etc/ssh/ssh_host_rsa_key.pub on the server; it's fingerprint can be printed using the command:

ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

In addition to user-specific known_hosts files, there may be a system-wide file /etc/ssh/ssh_known_hosts. This file is used both by the ssh client and by sshd for the hosts.equiv functionality. This file needs to be updated as well.

3. Check all OpenSSH user keys

The safest course of action is to regenerate all OpenSSH user keys, except where it can be established to a sufficient high degree of certainty that the key was generated on an unaffected system.

Check whether your key is affected by running the ssh-vulnkey tool, included in the security update. By default, ssh-vulnkey will check the standard location for user keys (~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/identity), your authorized_keys file (~/.ssh/authorized_keys and ~/.ssh/authorized_keys2), and the system's host keys (/etc/ssh/ssh_host_dsa_key and /etc/ssh/ssh_host_rsa_key).

To check all your own keys, assuming they are in the standard locations (~/.ssh/id_rsa, ~/.ssh/id_dsa, or ~/.ssh/identity):

ssh-vulnkey

To check all keys on your system:

sudo ssh-vulnkey -a

To check a key in a non-standard location:

ssh-vulnkey /path/to/key

If ssh-vulnkey says Unknown (no blacklist information), then it has no information about whether that key is affected. If in doubt, destroy the key and generate a new one.

4. Regenerate any affected user keys

OpenSSH keys used for user authentication must be manually regenerated, including those which may have been transferred to a different system after being generated.

New keys can be generated using ssh-keygen, e.g.:

5. Update authorized_keys files (if necessary)

Once the user keys have been regenerated, the relevant public keys must be propagated to any authorized_keys files (and authorized_keys2 files, if applicable) on remote systems. Be sure to delete the affected key.

This is just a reminder for those who (re-)generate PEM encodedcertificates. Your site probably has other policies in place about howto manage keys which you should follow. Additionally, you may need toget the certificates signed again by a 3rd party Certificate Authorityrather than by using a self-signed certificate as shown below:

The bincimap package automatically creates a self-signed certificatethrough the openssl program for the bincimap-ssl service, and puts itinto /etc/ssl/certs/imapd.pem. To regenerate, run:

Boxbackup is not present in Debian stable, only in testing/Lenny.

Upstream has published a first impact analysis of key material createdon system with insufficient random PRNG. You can read the detailshere.

If the PRNG in your OpenSSL was insufficiently random, you need to:

  • Regenerate all affected certificates, which have been generated orsigned on an affected system
  • Regenerate all the data keys (*-FileEncKeys.raw)
  • Destroy the data stored on your server to an appropriate level ofsecurity (overwrite with zeros at the least, more if you're paranoid)
  • Upload everything again
  • Take appropriate measures under the assumption that you have beenstoring your data in plain text on a public server without authentication.(i.e., start from scratch, destroying all trace of the backed updata, and take other measures to mitigate the exposure of yoursecrets)

Cryptsetup itself does not use openssl for encryption (this applies toboth LUKS and dm-crypt devices).

If cryptsetup has been configured to use SSL-encrypted keyfiles (anon-default setup which must be explicitly configured by the user)and a broken version of openssl was used to generate the keyfile, thekeyfile encryption may be weaker than expected (as the salt is nottruly random).

The solution is either to re-encrypt the keyfile (if you arereasonably certain that the encrypted key has not been disclosed toany third parties) or to wipe and reinstall the affected partition(s)using a new key.

Instructions for re-encrypting a keyfile:

Do the following for each SSL-encrypted keyfile, replacing<ssl_encrypted_key_path> with the path to the actual keyfile:

If you have /etc/ssh/*host* keys, either remove them, or follow theopenssh instructions first, before updating dropbear'skeys.

Dropbear's postinst converts existing openssh keys to dropbear format,if it cannot find the dropbear host keys.

Debian generate ssh key for user password

Note that keys that have been generated by Dropbear itself are notvulnerable (it uses libtomcrypt rather than OpenSSL).

Users of programs ekg or ekg2 (the latter is only in experimental) whouse the SIM encryption functionality, who generated a keypair usingthe /key [-g --generate] command (which uses libssl to do the job)should regenerate the keys, after upgrading libssl and restarting theprogram.

The upstream developers have posted a notice on their website:http://ekg.chmurka.net/index.php

If you need further help, please ask on ekg-users@lists.ziew.org orekg2-users@lists.ziew.org (both English and Polish).

This covers the default setup. If the local admin has setup furtherSSL infrastructure beyond that, these keys will need to be regeneratedas well.

The gforge-web-apache2 package in sid and lenny sets up the websitewith a dummy certificate if no existing certificate is found. Users are thenencouraged to replace it with a real one. The dummy certificate inquestion is the Snake Oil one, so it should already be known as a weakone (even without the SSL bug), but some users may acceptit without a second thought.

No part of MIT Kerberos in Debian 4.0 (Etch) uses OpenSSL, and so Kerberosin Debian 4.0 is not affected at all.

In Lenny the separate binary package krb5-pkinit uses OpenSSL. MITKerberos itself does not generate long-term key pairs even when the PKINITplugin is used, so any vulnerable long-term key pairs would have beengenerated outside of the MIT Kerberos software itself. The PKINIT pluginonly references existing key pairs and isn't responsible for keymanagement.

Long-term key pairs used with PKINIT may be affected if generated on anaffected Debian system, but such generation is external to MIT Kerberos.

However, the OpenSSL random key functions are used for the DH exchangewhen PKINIT authentication is used, which means that an attacker may beable to use brute-force to gain access to the KDC response to a PKINITauthentication and subsequently gain access to any sessions created usingservice tickets from that authentication.

Any KDCs using the PKINIT plugin from Lenny should have their libssl0.9.8packages upgraded immediately and the Kerberos KDC restarted with:

Any Kerberos ticket-granting tickets (TGTs) or encrypted sessions resultingfrom PKINIT authentication using a Kerberos KDC with the affected libsslshould be treated as suspect; it's possible that attackers with packetcaptures will be able to compromise those keys and sessions.

The Nessus server package (nessusd) post installation script createssome SSL keys for secure communication between a Nessus server and client.That communication channel should be considered compromised since a rogue usercould be able to intercept the information exchanged between the server and theclient (which includes information of remote hosts vulnerabilities) andpotentially could send commands to the servers as the logged in user.

Additionally, if the admin has created either the Nessus CA key or a usercertificate (with nessus-mkcert-client) for remote authentication in a serverwhich had installed the OpenSSL version affected by this security issue thosekeys should be considered compromised. Note that remote users with access tothe Nessus server can launch attacks to the servers they are allowed to attackand, if enabled on the local configuration (in Debian it defaults to no)upload plugins which would be executed in the Nessus server with rootprivileges.

The maintainer configuration scripts will regenerate the OpenSSL certificateswhen configured if it cannot find them. You will need to remove the certificatesand have it generate new ones doing:

Once this is done you will have to remove the old user keysat /var/lib/nessus/users/USERNAME/auth and regenerate them again withnessus-mkcert-client. Old keys will be invalid once the CA key has been removed.

After the CA key is regenerated you will also need to distribute the new CAcertificate to your users, and your users will have to accept the new certificatefrom the Nessus server once they reconnect. Certificate settings for the oldserver should be removed automatically but you can also remove them manually byediting the .nessusrc.cert (if using the Nessus client) or.openvasrc.cert (if using the OpenVAS client).

Beware: Restarting the ipsec services terminates all currently open IPSecconnections, which may need to be restarted from the other end.

Backup your secret key files. While key names are arbitrary, they canbe detected by running

Recreate them using

Then copy the shared secret keys to the remote hosts and restart the VPNon each host with

The Debian packaging doesn't include key generation, so the followingsteps should only be necessary if SSL keys have been created externally.

An upcoming proftpd upload to unstable will include a tls.conf templatewith the comment below.

Note that the self-signed certificate generation is bitdifferent from that suggested on the general openssl section, in orderto avoid using of an explicit password at daemon startup.

You can (re-)generate a self-signed certificate using a command like:

Both files must be readable by root only. The file paths can bechecked/configured through the following configuration directives:

There are two methods to handle puppet certificates, one is via capistrano,the second is manually.

Regenerating Puppet SSL Certificates using capistrano is detailed here:http://reductivelabs.com/trac/puppet/wiki/RegenerateSSL

The manual steps are as follows:

  1. You need to wipe and regenerate your CA info:

    However, if you are running mongrel, instead of starting puppetmaster fromthe init script, you will need to first stop the front-end web listener(apache, nginx, etc.) and then do the following:

    The above is necessary because for some reason when running with mongrel,puppetmaster will not regenerate its CA.

  2. Wipe all the client certs
  3. Have each client request a new cert:
  4. Once all the requests have rolled in, you can sign them all at once:
  5. Start up your puppet clients:

You could also enable autosign temporarily, if you are comfortable with that.

Sendmail (both in Etch and in Lenny) optionally creates default OpenSSLcertificates at install time.

The key rollover procedure is trivial:

If you have customized the templates in /etc/mail/tls, thosevalues will be re-used to create the new certificates.

Ssh

The snakeoil certificate /etc/ssl/certs/ssl-cert-snakeoil.pem can berecreated with:

This covers the default setup. If the local admin has setup furtherSSL infrastructure beyond that, these keys will need to be regeneratedas well.

Remove all suspect public and private key files:

  1. Remove rsa_key.priv.
  2. Edit all files in the hosts/ directory and remove the public key blocks.

/mcafee-internet-security-product-key-generator.html. Generate a new public/private key pair:

Debian Generate Ssh Key For User Password

Exchange your host config file with the new public key with othermembers of your VPN. Do not forget to restart your tinc daemons.

Tor is not in stable, but affected in Lenny.

Clients running 0.1.2.x are not affected. Tor nodes or hidden serviceproviders running any version, as well as everyone on 0.2.0.x areaffected.

Debian Generate Ssh Keys

Please see thevulnerabilityannouncement on the Tor announce mailing list.

Upgrading to 0.1.2.19-3 (available in testing, unstable, backports.org, andthe usual noreply.orgrepository) or 0.2.0.26-rc-1 (available in experimental and the usual noreply.orgrepository) is recommended. If you run a relay these versions will forcenew server keys (/var/lib/tor/keys/secret_*) to be generated.

Debian Generate Ssh Key For User Guide

Should you run a Tor node without using the package's infrastructure(debian-tor user, /var/lib/tor as DataDirectory etc.) you manually needto remove bad keys. See the advisory link posted above.

If you are a hidden service provider, and have created your key inthe affected timeframe with a bad libssl then please delete your hiddenservice's private key. This will change your hidden service's host nameand may require reconfiguring your servers.

Debian 10 Ssh

If you are running 0.2.0.x, an upgrade is highly recommended — 3 of the6 v3 authority servers have compromised keys. Old 0.2.0.x versionswill stop working in a week or two.

Generate Ssh Key Putty

xrdp uses generated keys. Most clients do not check those keys bydefault, therefore changing them is painless. You just have to:

xrdp is not in stable.