SSH key - MoodleDocs (2024)

Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.

What is a SSH key?

SSH keys are used for secure connections across a network. They come in pairs, so you have a public key and a private key.

The standard ssh2 file format (seehttp://www.openssh.org/txt/draft-ietf-secsh-publickeyfile-02.txt)looks like this:

---- BEGIN SSH2 PUBLIC KEY ----Comment: "jtbell@Jon-Bells-Computer"AAAAB3NzaC1kc3MAAACBAPNgmidbM2rhYjUXunpnlXjHWfV+vc8/5YKrn8Y5P0Y6KwmG2GGMgNBon3LX3iJlBhtuU3FCBj3G1Kdt5vUhQHhUmHVrOasi47vawTrv7ZJCfiaSGwRsiBHtJta5CAp7t0EnzX2q6BvPbFBBHNLyy6uNVpL2jOR06Pkx/vaqyScvAAAAFQDHvwmjWYwK9gK6Sp+pSvI7bwEUtwAAAIANMJDotMpfj89N+7+FJylSS+uFEQSS61PxENl/Mcj1jUREjJg2eNsJdAB9Ev99hWYS+7lFRtTJ2eh4Y9gpGe7BX3e2YGHOqp8cWCVCIKaMzwk9To+xnfThWqIfHT8I6CJxp/5ez02m6F2k/5iukvOwbGms6EAZK1DTBhDOHjEQwQAAAIAlz2/qBWkaMP+sW8FLmGKM+cCw5+asOaJGTwrFVuwJkDMvdEWxmG92A2dxuUske0d/AkN6zJp7HD0wlfesRM3+c+Res5qun9lFcdM4i03VoV5mXd+T7laS8yku6vZgvZZFnPvr2LOUnc7XThGFwMaQpFEWU8cvQbttO6QrT2CD2w==---- END SSH2 PUBLIC KEY ----

However, Moodle uses OpenSSH on its server and this key will not work with the OpenSSH server in this format; OpenSSH requires the key to be in OpenSSH format. Here is an example of a DSA public key in OpenSSH format (usually they are all in one line):

ssh-dss AAAAB3NzaC1kc3MAAACBAJ3hB5SAF6mBXPlZlRoJEZi0KSIN+NU2iGiaXZXi9CDrgVxTp6/sc56UcYCp4qjfrZ2G3+6PWbxYso4P4YyUC+61RU5KPy4EcTJske3O+aNvec/20cW7PT3TvH1+sxwGrymD50kTiXDgo5nXdqFvibgM61WW2DGTKlEUsZys0njRAAAAFQDs7ukaTGJlZdeznwFUAttTH9LrwwAAAIAMm4sLCdvvBx9WPkvWDX0OIXSteCYckiQxesOfPvz26FfYxuTG/2dljDlalC+kYG05C1NEcmZWSNESGBGfccSYSfI3Y5ahSVUhOC2LMO3JNjVyYUnOM/iyhzrnRfQoWO9GFMaugq0jBMlhZA4UO26yJqJ+BtXIyItaEEJdc/ghIwAAAIBFeCZynstlbBjP648+mDKIvzNSS+JYr5klGxS3q8A56NPcYhDMxGn7h1DKbb2AV4pO6y+6hDrWo3UT4dLVuzK01trwp PYp6JXTSZZ12ZaXNPz7sX9/z6pzMqhX4UEfjVsLcuF+ZS6aQCPO0ZZEa1z+EEIZSD/ykLQsDwPxGjPBqw== [email protected]

In addition to OpenSSH and Standard SSH formats there are a variety of proprietary formats as well as SSH1 and SSH2 differences to account for, which can make this confusing.

In the example above you will note that the key starts with "ssh-dss". This is because this key was generated using DSA as opposed to RSA. A number of vendors in the SSH arena have argued, as per the PuTTY documentation that can be found at http://the.earth.li/~sgtatham/putty/0.55/htmldoc/Chapter8.html#S8.2.10 that users should employ RSA encryption because

DSA has an intrinsic weakness which makes it very easy to create a signaturewhich contains enough information to give away the private key! This would allow an attacker to pretend to be you for any number of future sessions. 

An SSH2 public key in OpenSSH format will start with "ssh-rsa".

The idea behind all of this is that once you have keys on the remote server and your local host, access will be simpler since the server will only grant access to someone who has the matching private key.

Why do I need a SSH key?

Our CVS server uses OpenSSH, so if you are a Moodle developer and you want to make your logins easier (by avoiding typing in your password all the time) then you will need to submit public key in Openssh format via the "Update my developer information" tab at http://moodle.org/cvs.

How do I create a SSH key pair?

Eclipse

If you plan to use Eclipse for development, please refer to the Eclipse document https://docs.moodle.org/en/Eclipse as Eclipse now has a plugin that allows you to manage all ssh key matters from within Eclipse.

Unix/Linux

You can use ssh-keygen at your system prompt. Please consult the man page on your system for the options available to you.

  1. Run: ssh-keygen -t (rsa or dsa). This will not include a passphrase. *
  2. Use of rsa or dsa above will result in rsa or dsa replacing each XXX below.
  3. Look in your ~/.ssh directory (or wherever you saved the output). You'll find id_XXX (private) and id_XXX.pub (public).
  4. Cut and paste the contents of id_XXX.pub into your developer profile on http://moodle.org/cvs
  5. Put the private key wherever you will be calling CVS from (in your .ssh directory, for example). Make sure it's secure!
  • This section initially recommended using ssh-keygen -d but it is unclear what the source of this -d option might be.

Windows

Use puttygen and follow the instructions here. Make sure you choose the RSA2 key format and that when you copy the key data into the textbox on the site, that you have all of the characters on one line. If you have opened the key with word pad, it will have line breaks in it which will stop it from working.

The box should look like this:

ssh-rsaAAAAWfg&jkf4D34H5@4svf..... (single very long line continues beyond edge of textbox)

Mac OS X

If you have an existing key in Putty format, open it in puttygen on windows and then choose conversions and export as openssh format. You can then import the key into OS X using

 ssh-add -K filename

The -K flag is optional and stores your passphrase in the keychain ssh-add documentation

SSH key - MoodleDocs (2024)

FAQs

How to get an SSH key? ›

For Windows 10 & 11
  1. Press the Windows key or open up the Start Menu. Type “cmd”.
  2. Under “Best Match”, click “Command Prompt”.
  3. In the command prompt, use the ssh-keygen command: ...
  4. The system will now generate the key pair and display the key fingerprint and a randomart image. ...
  5. Open your file explorer.

How to login with SSH key? ›

Once your SSH key pair is generated, you need to place the public key on the server.
  1. Use the command `ssh-copy-id user@your_server_ip` to copy the public key. Replace `user` with your username and `your_server_ip` with your server's IP address.
  2. Enter your password when prompted.
Jul 10, 2019

Where is the SSH keys? ›

SSH keys are typically configured in an authorized_keys file in . ssh subdirectory in the user's home directory. Typically a system administrator would first create a key using ssh-keygen and then install it as an authorized key on a server using the ssh-copy-id tool.

How to generate SSH key DSA? ›

Use the ssh-keygen tool to create a key pair.
  1. Log in as the administrator user defined on the service form.
  2. Start the ssh-keygen tool. ...
  3. At the following prompt, accept the default or enter the file path where you want to save the key pair and press Enter.

How do I find my SSH public key? ›

How to view your SSH public key on Linux
  1. Using the ssh-agent command.
  2. Run the following command. ssh-agent sh -c 'ssh-add; ssh-add -L'
  3. After successful authentication, your SSH public key will be displayed in the terminal.
  4. Copy and paste it where you need it.
Sep 12, 2023

How to get SSH key from terminal? ›

Using the ssh-agent command
  1. Run the command: ssh-agent sh -c 'ssh-add; ssh-add -L'
  2. Upon successful authentication, your SSH public key will print out in the terminal.
  3. You can then copy that and paste it where you need it.
Jun 29, 2023

What is an example of a SSH key? ›

An example of an SSH key can be ssh-id-rsa This is an RSA key often stored in an SSH authorized_keys file. It is especially important for maintaining secure connections in Windows systems.

Where is my SSH host key? ›

In OpenSSH, host keys are usually stored in the /etc/ssh directory, in files starting with ssh_host_<rsa/dsa/ecdsa/ed25519>_key (the location can be changed in server configuration files).

How do I access SSH? ›

Log in with a Password
  1. Open a Terminal session.
  2. Run the following command: ssh -p port user@IP where port represents the port number, user represents your username, and IP represents your IP address. For example: user@workstation:~$ ssh -p 22 [email protected].
  3. Enter your password.
May 29, 2024

What is the SSH public key? ›

An SSH key is a secure access credential used in the Secure Shell (SSH) protocol. SSH key pairs use public key infrastructure (PKI) technology, the gold standard for digital identity authentication and encryption, to provide a secure and scalable method of authentication.

How do I copy my SSH public key? ›

Copying Public Keys to Remote Servers
  1. Use the ssh-copy-id command to append the public key in the local ~/.ssh/id_rsa.pub file to the ~/.ssh/authorized_keys file on the remote system, for example: ssh-copy-id remote_user@host.
  2. When prompted, enter the password for the remote system.

How do SSH keys work? ›

An SSH key is used to access a remote server through an SSH connection. The keys come in pairs, a public key and a private key. The public key is kept within the server and the private key is with the user or the client. The server authenticates the user by sending a message encrypted using the public key.

How do I get the SSH host key? ›

Host keys are normally generated automatically when OpenSSH is first installed or when the computer is first booted. The ssh-keygen program can be used for generating additional host keys or for replacing existing keys.

How to generate a RSA key? ›

Generate RSA Keys
  1. Open a shell using Putty or another utility.
  2. Use commands to generate an RSA key file. Type the following command to generate RSA keys: ssh-keygen -t rsa. ...
  3. Navigate to the. rsakey. folder that you created in step 2b. ...
  4. Locate the public key beginning with. ssh. and copy the key.

How do I get access to SSH? ›

Log in with a SSH Key
  1. Open a Terminal session.
  2. Run the following command: ssh -p port -i ssh-key user@IP where port represents the port number, ssh-key represents the file path to your SSH key, user represents your username, and IP represents your IP address. For example: ...
  3. Enter your SSH key password.
May 29, 2024

Top Articles
CIT Bank review 2024
What is Canva? Social Media Marketing Definitions - SocialBee
11 beste sites voor Word-labelsjablonen (2024) [GRATIS]
jazmen00 x & jazmen00 mega| Discover
Walgreens Pharmqcy
Davante Adams Wikipedia
2024 Fantasy Baseball: Week 10 trade values chart and rest-of-season rankings for H2H and Rotisserie leagues
Apply A Mudpack Crossword
Oriellys St James Mn
Hallelu-JaH - Psalm 119 - inleiding
Https //Advanceautoparts.4Myrebate.com
Nitti Sanitation Holiday Schedule
Craigslist Malone New York
House Of Budz Michigan
Apus.edu Login
Committees Of Correspondence | Encyclopedia.com
Der Megatrend Urbanisierung
CANNABIS ONLINE DISPENSARY Promo Code — $100 Off 2024
How pharmacies can help
Carson Municipal Code
623-250-6295
Wsop Hunters Club
eHerkenning (eID) | KPN Zakelijk
Wnem Tv5 Obituaries
kvoa.com | News 4 Tucson
Does Hunter Schafer Have A Dick
Myql Loan Login
104 Presidential Ct Lafayette La 70503
FAQ's - KidCheck
Lindy Kendra Scott Obituary
Co10 Unr
Downloahub
Www.craigslist.com Syracuse Ny
2015 Chevrolet Silverado 1500 for sale - Houston, TX - craigslist
Maybe Meant To Be Chapter 43
آدرس جدید بند موویز
Help with your flower delivery - Don's Florist & Gift Inc.
Missouri State Highway Patrol Will Utilize Acadis to Improve Curriculum and Testing Management
ENDOCRINOLOGY-PSR in Lewes, DE for Beebe Healthcare
Ise-Vm-K9 Eol
Craigslist Mexicali Cars And Trucks - By Owner
Craigslist Florida Trucks
Puretalkusa.com/Amac
Lacy Soto Mechanic
Linkbuilding uitbesteden
Brake Pads - The Best Front and Rear Brake Pads for Cars, Trucks & SUVs | AutoZone
25100 N 104Th Way
Quest Diagnostics Mt Morris Appointment
Understanding & Applying Carroll's Pyramid of Corporate Social Responsibility
Ingersoll Greenwood Funeral Home Obituaries
Jasgotgass2
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5643

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.