gs.but 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 server's host key is not cached in the registry. You have no
  42. \c guarantee that the server is the computer you think it is.
  43. \c The server's ssh-ed25519 key fingerprint is:
  44. \c ssh-ed25519 255 SHA256:TddlQk20DVs4LRcAsIfDN9pInKpY06D+h4kSHwWAj4w
  45. \c If you trust this host, press "Accept" to add the key to PuTTY's
  46. \c cache and carry on connecting.
  47. \c If you want to carry on connecting just once, without adding the key
  48. \c to the cache, press "Connect Once".
  49. \c If you do not trust this host, press "Cancel" to abandon the connection.
  50. This is a feature of the SSH protocol. It is designed to protect you
  51. against a network attack known as \i\e{spoofing}: secretly
  52. redirecting your connection to a different computer, so that you
  53. send your password to the wrong machine. Using this technique, an
  54. attacker would be able to learn the password that guards your login
  55. account, and could then log in as if they were you and use the
  56. account for their own purposes.
  57. To prevent this attack, each server has a unique identifying code,
  58. called a \e{host key}. These keys are created in a way that prevents
  59. one server from forging another server's key. So if you connect to a
  60. server and it sends you a different host key from the one you were
  61. expecting, PuTTY can warn you that the server may have been switched
  62. and that a spoofing attack might be in progress.
  63. PuTTY \I{host key cache}records the host key for each server you
  64. connect to, in the Windows \i{Registry}. Every time you connect to a
  65. server, it checks that the host key presented by the server is the
  66. same host key as it was the last time you connected. If it is not,
  67. you will see a warning, and you will have the chance to abandon your
  68. connection before you type any private information (such as a
  69. password) into it. (See \k{errors-hostkey-wrong} for what that looks
  70. like.)
  71. However, when you connect to a server you have not connected to
  72. before, PuTTY has no way of telling whether the host key is the
  73. right one or not. So it gives the warning shown above, and asks you
  74. whether you want to \I{trusting host keys}trust this host key or
  75. not.
  76. Whether or not to trust the host key is your choice. If you are
  77. connecting within a company network, you might feel that all the
  78. network users are on the same side and spoofing attacks are
  79. unlikely, so you might choose to trust the key without checking it.
  80. If you are connecting across a hostile network (such as the
  81. Internet), you should check with your system administrator, perhaps
  82. by telephone or in person. (When verifying the fingerprint, be careful
  83. with letters and numbers that can be confused with each other:
  84. \c{0}/\c{O}, \c{1}/\c{I}/\c{l}, and so on.)
  85. Many servers have more than one host key. If the system administrator
  86. sends you more than one \I{host key fingerprint}fingerprint, you should
  87. make sure the one PuTTY shows you is on the list, but it doesn't matter
  88. which one it is.
  89. If you don't have any fingerprints that look like the example
  90. (\I{SHA256 fingerprint}\c{SHA256:} followed by a long string of
  91. characters), but instead have pairs of characters separated by colons
  92. like \c{a4:db:96:a7:...}, try pressing the \q{More info...} button and
  93. see if you have a fingerprint matching the \q{\i{MD5 fingerprint}}
  94. there. This is an older and less secure way to summarise the same
  95. underlying host key; it's possible for an attacker to create their
  96. own host key with the same fingerprint; so you should avoid relying on
  97. this fingerprint format unless you have no choice. The
  98. \q{More info...} dialog box also shows the full host public key, in
  99. case that is easier to compare than a fingerprint.
  100. See \k{config-ssh-hostkey} for advanced options for managing host keys.
  101. \# FIXME: this is all very fine but of course in practice the world
  102. doesn't work that way. Ask the team if they have any good ideas for
  103. changes to this section!
  104. \H{gs-login} \ii{Logging in}
  105. After you have connected, and perhaps verified the server's host
  106. key, you will be asked to log in, probably using a \i{username} and
  107. a \i{password}. Your system administrator should have provided you
  108. with these. (If, instead, your system administrator has asked you to
  109. provide, or provided you with, a \q{public key} or \q{key file}, see
  110. \k{pubkey}.)
  111. PuTTY will display a text window (the \q{\i{terminal window}} \dash it
  112. will have a black background unless you've changed the defaults), and
  113. prompt you to type your username and password into that window. (These
  114. prompts will include the \i{PuTTY icon}, to distinguish them from any
  115. text sent by the server in the same window.)
  116. Enter the username and the password, and the server should grant you
  117. access and begin your session. If you have
  118. \I{mistyping a password}mistyped your password, most servers will give
  119. you several chances to get it right.
  120. While you are typing your password, you will not usually see the
  121. cursor moving in the window, but PuTTY \e{is} registering what you
  122. type, and will send it when you press Return. (It works this way to
  123. avoid revealing the length of your password to anyone watching your
  124. screen.)
  125. If you are using SSH, be careful not to type your username wrongly,
  126. because you will not have a chance to correct it after you press
  127. Return; many SSH servers do not permit you to make two login attempts
  128. using \i{different usernames}. If you type your username wrongly, you
  129. must close PuTTY and start again.
  130. If your password is refused but you are sure you have typed it
  131. correctly, check that Caps Lock is not enabled. Many login servers,
  132. particularly Unix computers, treat upper case and lower case as
  133. different when checking your password; so if Caps Lock is on, your
  134. password will probably be refused.
  135. \H{gs-session} After logging in
  136. After you log in to the server, what happens next is up to the
  137. server! Most servers will print some sort of login message and then
  138. present a \i{prompt}, at which you can type
  139. \I{commands on the server}commands which the
  140. server will carry out. Some servers will offer you on-line help;
  141. others might not. If you are in doubt about what to do next, consult
  142. your system administrator.
  143. \H{gs-logout} \ii{Logging out}
  144. When you have finished your session, you should log out by typing
  145. the server's own logout command. This might vary between servers; if
  146. in doubt, try \c{logout} or \c{exit}, or consult a manual or your
  147. system administrator. When the server processes your logout command,
  148. the PuTTY window should close itself automatically.
  149. You \e{can} close a PuTTY session using the \i{Close button} in the
  150. window border, but this might confuse the server - a bit like
  151. hanging up a telephone unexpectedly in the middle of a conversation.
  152. We recommend you do not do this unless the server has stopped
  153. responding to you and you cannot close the window any other way.