api-auth.texi 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. @c -*-texinfo-*-
  2. @c This file is part of Guile-SSH Reference Manual.
  3. @c Copyright (C) 2014 Artyom V. Poptsov
  4. @c See the file guile-ssh.texi for copying conditions.
  5. @node Auth
  6. @section Auth
  7. @cindex authentication
  8. The @code{(ssh auth)} module provides authentication procedures for a
  9. Guile-SSH client.
  10. Please note that you must specify a username either on creation of a
  11. session or by @code{session-set!} call (@pxref{Sessions}) before
  12. calling of procedures from this section.
  13. Also @strong{note} that the session must be connected before calling to these
  14. procedures, otherwise the @code{wrong-type-arg} exception will be thrown.
  15. @deffn {Scheme Procedure} userauth-public-key! session private-key
  16. Try to authenticate with a public/private key.
  17. Return one of the following symbols:
  18. @table @samp
  19. @item success
  20. Authentication success.
  21. @item partial
  22. You've been partially authenticated, you still have to use another
  23. method.
  24. @item denied
  25. Authentication failed: use another method.
  26. @item error
  27. A serious error happened.
  28. @end table
  29. @end deffn
  30. @deffn {Scheme Procedure} userauth-public-key/auto! session
  31. @cindex authentication with a SSH agent
  32. Try to automatically authenticate with @code{none} method first and
  33. then with public keys. The procedure will try to get a cached private
  34. key from a @acronym{SSH} agent and if it fails it will try to read a
  35. key from a file. If the key is encrypted the user will be asked for a
  36. passphrase.
  37. Return one of the following symbols:
  38. @table @samp
  39. @item success
  40. Authentication success.
  41. @item partial
  42. You've been partially authenticated, you still have to use another
  43. method.
  44. @item denied
  45. Authentication failed: use another method.
  46. @item error
  47. A serious error happened.
  48. @end table
  49. @end deffn
  50. @deffn {Scheme Procedure} userauth-public-key/try session public-key
  51. Try to authenticate with the given @var{public-key}.
  52. To avoid unnecessary processing and user interaction, the following
  53. method is provided for querying whether authentication using the
  54. @var{public-key} would be possible.
  55. Return one of the following symbols:
  56. @table @samp
  57. @item success
  58. The public key is accepted, you want now to use
  59. @code{userauth-public-key!}.
  60. @item partial
  61. You've been partially authenticated, you still have to use another
  62. method.
  63. @item denied
  64. Authentication failed: use another method.
  65. @item error
  66. A serious error happened.
  67. @end table
  68. @end deffn
  69. @deffn {Scheme Procedure} userauth-agent! session
  70. Try to do public key authentication with ssh agent.
  71. Return one of the following symbols:
  72. @table @samp
  73. @item success
  74. Authentication success.
  75. @item partial
  76. You've been partially authenticated, you still have to use another
  77. method.
  78. @item denied
  79. Authentication failed: use another method.
  80. @item error
  81. A serious error happened.
  82. @end table
  83. @end deffn
  84. @deffn {Scheme Procedure} userauth-password! session password
  85. Try to authenticate by @var{password}.
  86. Return one of the following symbols:
  87. @table @samp
  88. @item success
  89. Authentication success.
  90. @item partial
  91. You've been partially authenticated, you still have to use another
  92. method.
  93. @item denied
  94. Authentication failed: use another method.
  95. @item error
  96. A serious error happened.
  97. @item again
  98. In nonblocking mode, you've got to call this again later.
  99. @end table
  100. @end deffn
  101. @deffn {Scheme Procedure} userauth-none! session
  102. Try to authenticate through the @code{none} method.
  103. Return one of the following symbols:
  104. @table @samp
  105. @item success
  106. Authentication success.
  107. @item partial
  108. You've been partially authenticated, you still have to use another method.
  109. @item again
  110. In nonblocking mode, you've got to call this again later.
  111. @item denied
  112. Authentication failed: use another method.
  113. @item error
  114. A serious error happened.
  115. @end table
  116. @end deffn
  117. @deffn {Scheme Procedure} userauth-get-list session
  118. Get available authentication methods for a @var{session}. Return list
  119. of available methods.
  120. This call will block, even in nonblocking mode, if run for the first
  121. time before a (complete) call to @code{userauth-none!}.
  122. Possible methods are: @code{password}, @code{public-key},
  123. @code{host-based}, @code{interactive}.
  124. @end deffn
  125. @c Local Variables:
  126. @c TeX-master: "guile-ssh.texi"
  127. @c End: