Configure ssh daemon
- Open Cygwin command prompt
- Execute the following command
ssh-host-config
- When asked if privilege separation should be used, answer
no.
- When asked if sshd should be installed as a service, answer
yes.
- When asked about the value of CYGWIN environment variable
enter ntsec.
- Here is the example session of this command, note that the input typed by
the user is shown in pink and output from the system is shown in gray.
Example of using ssh-host-config
Start SSH daemon
- Find my computer icon either on your desktop or in the start-up menu,
right-click on it and select Manage from the context
menu.
- Open Services and Applications in the left-hand
panel then select theServices item.
- Find the CYGWIN sshd item in the main section
and right-click on it.
- Select Start from the context menu.
Start
SSHD service
- A small window should pop-up indicating the progress of the service
start-up. After that window disappears the status of CYGWIN sshd service
should change to Started.
Setup authorization keys
Eclipse plugins and hadoop scripts require ssh authentication to be performed
through authorization keys rather than through passwords. To enable key based
authorization you have to setup authorization keys. The following steps describe
how to do it.
- Open cygwin command prompt
- Execute the following command to generate keys
ssh-keygen
- When prompted for filenames and pass phrases press ENTER to accept default
values.
- After command has finished generating they key, enter the following
command to change into your .ssh directory
cd ~/.ssh
- Check if the keys where indeed generated by executing the following
command
ls -l
You should see two file id_rsa.pub and
id_rsa with the recent creation dates. These files contain
authorization keys.
- To register the new authorization keys enter the following command. Note
that double brackets, they are very important.
cat id_rsa.pub >> authorized_keys
- Now check if the keys where set-up correctly by executing the following
command
ssh localhost
Since it is a new ssh installation you warned that authenticity of the host
could not be established and will be prompted whether you really want to
connect, answer yes and press ENTER. You should see
the cygwin prompt again, which means that you have successfully connected.
- Now execute the command again
ssh localhost
This time you should not be prompted for anything.
Setting up authorization keys
Installing Cygwin on Windows 7 And Configure SSH,布布扣,bubuko.com
Installing Cygwin on Windows 7 And Configure SSH
原文:http://www.cnblogs.com/yefengmeander/p/3619496.html