Cygwin installing the SSHD service and implementing a password-free login

Source: Internet
Author: User

http://blog.csdn.net/cybercode/article/details/7080743

This article is intended for me to build a Hadoop environment in Win7 (64-bit). First, refer to the use summary in Cygwin this article to install the necessary packages in Cygwin, and then proceed as follows:

[Plain]View Plaincopy
  1. Sony@sony-vaio~ $ ssh-host-config
  2. Info:generating/etc/ssh_host_key
  3. Info:generating/etc/ssh_host_rsa_key
  4. Info:generating/etc/ssh_host_dsa_key
  5. Info:generating/etc/ssh_host_ecdsa_key
  6. info:creating default/etc/ssh_config File
  7. info:creating default/etc/sshd_config File
  8. Info:privilege separation is set to Yes by default since OpenSSH 3.3.
  9. Info:however, this requires a non-privileged account called ' sshd '.
  10. Info:for More info on privilege separation read/usr/share/doc/openssh/read
  11. Me.privsep.
  12. Query:should privilege separation be used? (yes/no) No
  13. Info:updating/etc/sshd_config file
  14. Query:do want to install sshd as a service?
  15. Query: (Say "No" if it is already installed as a service) (yes/no) Yes
  16. Query:enter the value of CYGWIN for the daemon:netsec] Netsec
  17. Info:on Windows Server 2003, Windows Vista, and above, the
  18. Info:system account cannot setuid to other users--a capability
  19. INFO:SSHD requires. You need to has or to create a privileged
  20. Info:account. This script would help you to do so.
  21. Info:you appear to be running Windows XP 64bit, Windows 2003 Server,
  22. Info:or later. On these systems, it's not possible to use the LocalSystem
  23. Info:account for services which can change the user ID without an
  24. Info:explicit password (such as passwordless logins [e.g. public key
  25. Info:authentication] via sshd).
  26. Info:if want to enable that functionality, it's required to create
  27. Info:a new account with special privileges (unless a similar account
  28. Info:already exists). Used to run these special
  29. Info:servers.
  30. Info:note that creating a new user requires that the current account
  31. Info:have Administrator privileges itself.
  32. Info:no privileged account could is found.
  33. Info:this script plans to use ' cyg_server '.
  34. Info: ' Cyg_server ' is only being used by registered services.
  35. Query:do want to use a different name? (yes/no) Yes
  36. Query:enter the new user Name:sony
  37. Query:Reenter:sony
  38. warning:privileged account ' Sony ' was specified,
  39. Warning:but It does not has the necessary privileges.
  40. Warning:continuing, but would probably use a different account.
  41. Warning:the specified account ' Sony ' does not having the
  42. warning:required permissions or group memberships. This May
  43. Warning:cause problems if not corrected; Continuing ...
  44. Query:please Enter the password for user ' Sony ':
  45. Query:reenter:
  46. Info:the sshd Service has been installed under the ' Sony '
  47. Info:account. To start the service now, call ' net start sshd ' or
  48. Info: ' Cygrunsrv-s sshd '. Otherwise, it'll start automatically
  49. Info:after the next reboot.
  50. Info:host configuration finished. Have fun!

$ net start sshd
A system error 1069---indicates that the service could not be started because of a logon failure

Workaround: Enter services.msc in cmd to open the Windows service and change the password in the service.
(in the process of configuring SSH above, my username is: Sony password is: 123456)

SSHD service installed successfully as follows:

[Plain]View Plaincopy
    1. [Email protected] ~ $ net start sshd
    2. CYGWIN sshd Service is starting.
    3. CYGWIN sshd Service has started successfully

Next is configure no password login:

[Plain]View Plaincopy
  1. [Email protected] ~ $ ssh-keygen-t RSA
  2. Generating public/private RSA key pair.
  3. Enter file in which to save the key (/HOME/SONY/.SSH/ID_RSA):
  4. Created directory '/home/sony/.ssh '.
  5. Enter passphrase (empty for no passphrase):
  6. Enter same Passphrase again:
  7. Your identification has been saved In/home/sony/.ssh/id_rsa.
  8. Your public key has been saved in/home/sony/.ssh/id_rsa.pub.
  9. The key fingerprint is:
  10. e8:38:5e:e3:bb:cf:76:03:61:5f:f2:68:ed:a3:49:db [email protected]
  11. The key ' s Randomart image is:
  12. +--[RSA 2048]----+
  13. | |
  14. | |
  15. | |
  16. | . O.    . |
  17. | .. So * |
  18. | O. + O |
  19. |     O + O.. |
  20. | . + O.. O+o |
  21. | .   +=o.+oe. |
  22. +-----------------+
  23. [Email protected] ~ $ CD. ssh/
  24. [Email protected] ~/.SSH $ ls
  25. Id_rsa id_rsa.pub
  26. [Email protected] ~/.SSH $ CP id_rsa.pub Authorized_keys
  27. [Email protected] ~/.SSH $ ls
  28. Authorized_keys Id_rsa id_rsa.pub

Verify the following:

[Plain]View Plaincopy
      1. [Email protected] ~/.ssh $ ssh localhost
      2. The authenticity of host ' localhost ' (:: 1) ' can ' t be established.
      3. ECDSA key fingerprint is 5f:21:b1:24:80:92:f6:af:3e:e3:a8:f9:cb:a4:4f:ec.
      4. Is you sure want to continue connecting (yes/no)? Yes
      5. warning:permanently added ' localhost ' (ECDSA) to the list of known hosts.
      6. [Email protected] ~ $ who
      7. Sony Tty0 2011-11-25 15:42 (:: 1)

Cygwin installing the SSHD service and implementing a password-free login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.