⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pubkey.but

📁 大名鼎鼎的远程登录软件putty的Symbian版源码
💻 BUT
📖 第 1 页 / 共 2 页
字号:
\versionid $Id: pubkey.but,v 1.1.1.2.6.2 2004/12/29 11:32:21 pekangas Exp $\C{pubkey} Using public keys for SSH authentication\H{pubkey-intro} Public key authentication - an introductionPublic key authentication is an alternative means of identifyingyourself to a login server, instead of typing a password. It is moresecure and more flexible, but more difficult to set up.In conventional password authentication, you prove you are who youclaim to be by proving that you know the correct password. The onlyway to prove you know the password is to tell the server what youthink the password is. This means that if the server has beenhacked, or \e{spoofed} (see \k{gs-hostkey}), an attacker can learnyour password.Public key authentication solves this problem. You generate a \e{keypair}, consisting of a public key (which everybody is allowed toknow) and a private key (which you keep secret and do not give toanybody). The private key is able to generate \e{signatures}.A signature created using your private key cannot be forged byanybody who does not have that key; but anybody who has your publickey can verify that a particular signature is genuine.So you generate a key pair on your own computer, and you copy thepublic key to the server. Then, when the server asks you to provewho you are, PuTTY can generate a signature using your private key.The server can verify that signature (since it has your public key)and allow you to log in. Now if the server is hacked or spoofed, theattacker does not gain your private key or password; they only gainone signature. And signatures cannot be re-used, so they have gainednothing.There is a problem with this: if your private key is storedunprotected on your own computer, then anybody who gains access to\e{that} will be able to generate signatures as if they were you. Sothey will be able to log in to your server under your account. Forthis reason, your private key is usually \e{encrypted} when it isstored on your local machine, using a passphrase of your choice. Inorder to generate a signature, PuTTY must decrypt the key, so youhave to type your passphrase.This can make public-key authentication less convenient thanpassword authentication: every time you log in to the server,instead of typing a short password, you have to type a longerpassphrase. One solution to this is to use an \e{authenticationagent}, a separate program which holds decrypted private keys andgenerates signatures on request. PuTTY's authentication agent iscalled Pageant. When you begin a Windows session, you start Pageantand load your private key into it (typing your passphrase once). Forthe rest of your session, you can start PuTTY any number of timesand Pageant will automatically generate signatures without youhaving to do anything. When you close your Windows session, Pageantshuts down, without ever having stored your decrypted private key ondisk. Many people feel this is a good compromise between securityand convenience. See \k{pageant} for further details.There is more than one public-key algorithm available. The mostcommon is RSA, but others exist, notably DSA (otherwise known asDSS), the USA's federal Digital Signature Standard. The key typessupported by PuTTY are described in \k{puttygen-keytype}.\H{pubkey-puttygen} Using PuTTYgen, the PuTTY key generator\cfg{winhelp-topic}{puttygen.general}PuTTYgen is a key generator. It generates pairs of public and privatekeys to be used with PuTTY, PSCP, and Plink, as well as the PuTTYauthentication agent, Pageant (see \k{pageant}).  PuTTYgen generatesRSA and DSA keys.When you run PuTTYgen you will see a window where you have twochoices: \q{Generate}, to generate a new public/private key pair, or\q{Load} to load in an existing private key.\S{puttygen-generating} Generating a new keyThis is a general outline of the procedure for generating a new keypair. The following sections describe the process in more detail.\b First, you need to select which type of key you want to generate,and also select the strength of the key. This is described in moredetail in \k{puttygen-keytype} and\k{puttygen-strength}.\b Then press the \q{Generate} button, to actually generate the key.\K{puttygen-generate} describes this step.\b Once you have generated the key, select a comment field(\k{puttygen-comment}) and a passphrase (\k{puttygen-passphrase}).\b Now you're ready to save the private key to disk; press the\q{Save private key} button. (See \k{puttygen-savepriv}).Your key pair is now ready for use. You may also want to copy thepublic key to your server, either by copying it out of the \q{Publickey for pasting into authorized_keys file} box (see\k{puttygen-pastekey}), or by using the \q{Save public key} button(\k{puttygen-savepub}). However, you don't need to do thisimmediately; if you want, you can load the private key back intoPuTTYgen later (see \k{puttygen-load}) and the public key will beavailable for copying and pasting again.\k{pubkey-gettingready} describes the typical process of configuringPuTTY to attempt public-key authentication, and configuring your SSHserver to accept it.\S{puttygen-keytype} Selecting the type of key\cfg{winhelp-topic}{puttygen.keytype}Before generating a key pair using PuTTYgen, you need to selectwhich type of key you need. PuTTYgen currently supports three typesof key:\b An RSA key for use with the SSH 1 protocol.\b An RSA key for use with the SSH 2 protocol.\b A DSA key for use with the SSH 2 protocol.The SSH 1 protocol only supports RSA keys; if you will be connectingusing the SSH 1 protocol, you must select the first key type or yourkey will be completely useless.The SSH 2 protocol supports more than one key type. The two typessupported by PuTTY are RSA and DSA.The PuTTY developers \e{strongly} recommend you use RSA. DSA has anintrinsic weakness which makes it very easy to create a signaturewhich contains enough information to give away the \e{private} key!This would allow an attacker to pretend to be you for any number offuture sessions. PuTTY's implementation has taken very carefulprecautions to avoid this weakness, but we cannot be 100% certain wehave managed it, and if you have the choice we strongly recommendusing RSA keys instead.If you really need to connect to an SSH server which only supportsDSA, then you probably have no choice but to use DSA. If you do useDSA, we recommend you do not use the same key to authenticate withmore than one server.\S{puttygen-strength} Selecting the size (strength) of the key\cfg{winhelp-topic}{puttygen.bits}The \q{Number of bits} input box allows you to choose the strengthof the key PuTTYgen will generate.Currently 1024 bits should be sufficient for most purposes.Note that an RSA key is generated by finding two primes of half thelength requested, and then multiplying them together. For example,if you ask PuTTYgen for a 1024-bit RSA key, it will create two512-bit primes and multiply them. The result of this multiplicationmight be 1024 bits long, or it might be only 1023; so you may notget the exact length of key you asked for. This is perfectly normal,and you do not need to worry. The lengths should only ever differ byone, and there is no perceptible drop in security as a result.DSA keys are not created by multiplying primes together, so theyshould always be exactly the length you asked for.\S{puttygen-generate} The \q{Generate} button\cfg{winhelp-topic}{puttygen.generate}Once you have chosen the type of key you want, and the strength ofthe key, press the \q{Generate} button and PuTTYgen will begin theprocess of actually generating the key.First, a progress bar will appear and PuTTYgen will ask you to movethe mouse around to generate randomness. Wave the mouse in circlesover the blank area in the PuTTYgen window, and the progress barwill gradually fill up as PuTTYgen collects enough randomness. Youdon't need to wave the mouse in particularly imaginative patterns(although it can't hurt); PuTTYgen will collect enough randomnessjust from the fine detail of \e{exactly} how far the mouse has movedeach time Windows samples its position.When the progress bar reaches the end, PuTTYgen will begin creatingthe key. The progress bar will reset to the start, and graduallymove up again to track the progress of the key generation. It willnot move evenly, and may occasionally slow down to a stop; this isunfortunately unavoidable, because key generation is a randomprocess and it is impossible to reliably predict how long it willtake.When the key generation is complete, a new set of controls willappear in the window to indicate this.\S{puttygen-fingerprint} The \q{Key fingerprint} box\cfg{winhelp-topic}{puttygen.fingerprint}The \q{Key fingerprint} box shows you a fingerprint value for thegenerated key. This is derived cryptographically from the \e{public}key value, so it doesn't need to be kept secret.The fingerprint value is intended to be cryptographically secure, inthe sense that it is computationally infeasible for someone toinvent a second key with the same fingerprint, or to find a key witha particular fingerprint. So some utilities, such as the Pageant keylist box (see \k{pageant-mainwin-keylist}) and the Unix \c{ssh-add}utility, will list key fingerprints rather than the whole public key.\S{puttygen-comment} Setting a comment for your key\cfg{winhelp-topic}{puttygen.comment}If you have more than one key and use them for different purposes,you don't need to memorise the key fingerprints in order to tellthem apart. PuTTY allows you to enter a \e{comment} for your key,which will be displayed whenever PuTTY or Pageant asks you for thepassphrase.The default comment format, if you don't specify one, contains thekey type and the date of generation, such as \c{rsa-key-20011212}.Another commonly used approach is to use your name and the name of

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -