gs.but 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. \C{gs} Getting started with PuTTY
  2. This chapter gives a quick guide to the simplest types of
  3. interactive login session using PuTTY.
  4. \H{gs-insecure} \ii{Starting a session}
  5. When you start PuTTY, you will see a \i{dialog box}. This dialog box
  6. allows you to control everything PuTTY can do. See \k{config} for
  7. details of all the things you can control.
  8. You don't usually need to change most of the configuration options.
  9. To start the simplest kind of session, all you need to do is to
  10. enter a few basic parameters.
  11. In the \q{Host Name} box, enter the Internet \i{host name} of the server
  12. you want to connect to. You should have been told this by the
  13. provider of your login account.
  14. Now select a login \i{protocol} to use, from the \q{Connection type}
  15. controls. For a login session, you should select \i{SSH}, \i{Telnet},
  16. \i{Rlogin}, or \i{SUPDUP}. See \k{which-one} for a description of the
  17. differences between these protocols, and advice on which one to
  18. use. The \I{raw protocol}\e{Raw} protocol is not used for interactive
  19. login sessions; you would usually use this for debugging other Internet
  20. services (see \k{using-rawprot}). The \e{Serial} option is used for
  21. connecting to a local serial line, and works somewhat differently:
  22. see \k{using-serial} for more information on this.
  23. \#{FIXME: describe bare ssh-connection}
  24. When you change the selected protocol, the number in the \q{Port}
  25. box will change. This is normal: it happens because the various
  26. login services are usually provided on different network ports by
  27. the server machine. Most servers will use the standard port numbers,
  28. so you will not need to change the port setting. If your server
  29. provides login services on a non-standard port, your system
  30. administrator should have told you which one. (For example, many
  31. \i{MUDs} run Telnet service on a port other than 23.)
  32. Once you have filled in the \q{Host Name}, \q{Connection type}, and
  33. possibly \q{Port} settings, you are ready to connect. Press the
  34. \q{Open} button at the bottom of the dialog box, and PuTTY will
  35. begin trying to connect you to the server.
  36. \H{gs-hostkey} \ii{Verifying the host key} (SSH only)
  37. If you are not using the \i{SSH} protocol, you can skip this
  38. section.
  39. If you are using SSH to connect to a server for the first time, you
  40. will probably see a message looking something like this:
  41. \c The host key is not cached for this server:
  42. \c ssh.example.com (port 22)
  43. \c You have no guarantee that the server is the computer you think it is.
  44. \c The server's ssh-ed25519 key fingerprint is:
  45. \c ssh-ed25519 255 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w
  46. \c If you trust this host, press "Accept" to add the key to PuTTY's
  47. \c cache and carry on connecting.
  48. \c If you want to carry on connecting just once, without adding the key
  49. \c to the cache, press "Connect Once".
  50. \c If you do not trust this host, press "Cancel" to abandon the connection.
  51. This is a feature of the SSH protocol. It is designed to protect you
  52. against a network attack known as \i\e{spoofing}: secretly
  53. redirecting your connection to a different computer, so that you
  54. send your password to the wrong machine. Using this technique, an
  55. attacker would be able to learn the password that guards your login
  56. account, and could then log in as if they were you and use the
  57. account for their own purposes.
  58. To prevent this attack, each server has a unique identifying code,
  59. called a \e{host key}. These keys are created in a way that prevents
  60. one server from forging another server's key. So if you connect to a
  61. server and it sends you a different host key from the one you were
  62. expecting, PuTTY can warn you that the server may have been switched
  63. and that a spoofing attack might be in progress.
  64. PuTTY \I{host key cache}records the host key for each server you
  65. connect to, in the Windows \i{Registry}. Every time you connect to a
  66. server, it checks that the host key presented by the server is the
  67. same host key as it was the last time you connected. If it is not,
  68. you will see a stronger warning, and you will have the chance to
  69. abandon your connection before you type any private information (such
  70. as a password) into it. (See \k{errors-hostkey-wrong} for what that
  71. looks like.)
  72. However, when you connect to a server you have not connected to
  73. before, PuTTY has no way of telling whether the host key is the
  74. right one or not. So it gives the warning shown above, and asks you
  75. whether you want to \I{trusting host keys}trust this host key or
  76. not.
  77. Whether or not to trust the host key is your choice. If you are
  78. connecting within a company network, you might feel that all the
  79. network users are on the same side and spoofing attacks are
  80. unlikely, so you might choose to trust the key without checking it.
  81. If you are connecting across a hostile network (such as the
  82. Internet), you should check with your system administrator, perhaps
  83. by telephone or in person. (When verifying the fingerprint, be careful
  84. with letters and numbers that can be confused with each other:
  85. \c{0}/\c{O}, \c{1}/\c{I}/\c{l}, and so on.)
  86. Many servers have more than one host key. If the system administrator
  87. sends you more than one \I{host key fingerprint}fingerprint, you should
  88. make sure the one PuTTY shows you is on the list, but it doesn't matter
  89. which one it is.
  90. If you don't have any fingerprints that look like the example
  91. (\I{SHA256 fingerprint}\c{SHA256:} followed by a long string of
  92. characters), but instead have pairs of characters separated by colons
  93. like \c{a4:db:96:a7:...}, try pressing the \q{More info...} button and
  94. see if you have a fingerprint matching the \q{\i{MD5 fingerprint}}
  95. there. This is an older and less secure way to summarise the same
  96. underlying host key; it's possible for an attacker to create their
  97. own host key with the same fingerprint; so you should avoid relying on
  98. this fingerprint format unless you have no choice. The
  99. \q{More info...} dialog box also shows the full host public key, in
  100. case that is easier to compare than a fingerprint.
  101. See \k{config-ssh-hostkey} for advanced options for managing host keys.
  102. \# FIXME: this is all very fine but of course in practice the world
  103. doesn't work that way. Ask the team if they have any good ideas for
  104. changes to this section!
  105. \H{gs-login} \ii{Logging in}
  106. After you have connected, and perhaps verified the server's host
  107. key, you will be asked to log in, probably using a \i{username} and
  108. a \i{password}. Your system administrator should have provided you
  109. with these. (If, instead, your system administrator has asked you to
  110. provide, or provided you with, a \q{public key} or \q{key file}, see
  111. \k{pubkey}.)
  112. PuTTY will display a text window (the \q{\i{terminal window}} \dash it
  113. will have a black background unless you've changed the defaults), and
  114. prompt you to type your username and password into that window. (These
  115. prompts will include the \i{PuTTY icon}, to distinguish them from any
  116. text sent by the server in the same window.)
  117. Enter the username and the password, and the server should grant you
  118. access and begin your session. If you have
  119. \I{mistyping a password}mistyped your password, most servers will give
  120. you several chances to get it right.
  121. While you are typing your password, you will not usually see the
  122. cursor moving in the window, but PuTTY \e{is} registering what you
  123. type, and will send it when you press Return. (It works this way to
  124. avoid revealing the length of your password to anyone watching your
  125. screen.)
  126. If you are using SSH, be careful not to type your username wrongly,
  127. because you will not have a chance to correct it after you press
  128. Return; many SSH servers do not permit you to make two login attempts
  129. using \i{different usernames}. If you type your username wrongly, you
  130. must close PuTTY and start again.
  131. If your password is refused but you are sure you have typed it
  132. correctly, check that Caps Lock is not enabled. Many login servers,
  133. particularly Unix computers, treat upper case and lower case as
  134. different when checking your password; so if Caps Lock is on, your
  135. password will probably be refused.
  136. \H{gs-session} After logging in
  137. After you log in to the server, what happens next is up to the
  138. server! Most servers will print some sort of login message and then
  139. present a \i{prompt}, at which you can type
  140. \I{commands on the server}commands which the
  141. server will carry out. Some servers will offer you on-line help;
  142. others might not. If you are in doubt about what to do next, consult
  143. your system administrator.
  144. \H{gs-logout} \ii{Logging out}
  145. When you have finished your session, you should log out by typing
  146. the server's own logout command. This might vary between servers; if
  147. in doubt, try \c{logout} or \c{exit}, or consult a manual or your
  148. system administrator. When the server processes your logout command,
  149. the PuTTY window should close itself automatically.
  150. You \e{can} close a PuTTY session using the \i{Close button} in the
  151. window border, but this might confuse the server - a bit like
  152. hanging up a telephone unexpectedly in the middle of a conversation.
  153. We recommend you do not do this unless the server has stopped
  154. responding to you and you cannot close the window any other way.