Article I.
On a Linux host (SSH client),
SSH keys via Ssh-keygen
# ssh-keygen-t RSA (three consecutive returns, i.e. locally generated public and private keys, no password set)
The. SSH directory in the current user home directory of the Linux host, which generates Id_rsa.pub and Id_rsa, where Id_rsa is the key, Id_rsa.pub is the public key, you need to upload the id_rsa.pub (SSH server, Which is the Windows machine equipped with WINSSHD)
You can use the following command
CD ~/.ssh
SCP id_rsa.pub [Email protected]:/d:/data
2. Import the public key into the WINSSHD
Open Easy setting–>virtual Accounts
Click the Add button,,, enter a name, such as Codeif, in the list of 0 keys after the Edit button, import just the public key can not enter the password, Linux can use the SCP command from the machine containing winsshd to get files
Ways to attach files to Windows and Linux:
In order to perform system maintenance operation, sometimes need to re-transfer files between Windows and Linux or UNIX systems, although there are many tools to implement this function, but I still feel that the command line comes in handy, initially using the Linux SCP command, always unsuccessful, the internet is not related to the introduction, After several efforts, finally successfully found out the SCP command in the path of writing windows, and immediately came out to share with you:
Copying files from a Linux system to a Windows system: scp/oracle/a.txt [Email protected]:/d:/
In a Linux environment, copy files under Windows to a Linux system: SCP [Email protected]:/d:/test/config.ips/oracle
Note: Because the Windows system itself does not support the SSH protocol, in order for the above command to execute successfully, the Windows client must install SSH for Windows client software, such as WINSSHD, to enable the Windows system to support the SSH protocol.
http://www.codeif.com/topic/564
Article Two,
http://blog.163.com/lgh_2002/blog/static/44017526201011333227161/
Ssky-keygen + ssh-copy-id No password login remote Linux host "OK"
2010-12-03 15:32:27| Category: Linux/unix | Font Subscription
Using Ssky-keygen and Ssh-copy-id in the example below, you can log in to a remote Linux host with a simple setup of 3 steps without entering a password.
Ssh-keygen create public keys and keys.
The Ssh-copy-id copies the local host's public key to the remote host's Authorized_keys file.
Ssh-copy-id also sets the appropriate permissions for the remote host's user home directory (home) and ~/.ssh, and ~/.ssh/authorized_keys.
Step 1: Create a public key and key on the local host with Ssh-key-gen
[Email protected]$ ssh-keygen-t RSA
Enter file in which to save the key (/HOME/JSMITH/.SSH/ID_RSA): [Enter key]
Enter passphrase (empty for no passphrase): [Press ENTER key]
Enter same passphrase again: [Pess enter key]
Your identification has been saved In/home/jsmith/.ssh/id_rsa.
Your public key has been saved in/home/jsmith/.ssh/id_rsa.pub.
The key fingerprint is:33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9
[Email protected]
Step 2: Use Ssh-copy-id to copy the public key to the remote host
[Email protected]$ ssh-copy-id-i ~/.ssh/id_rsa.pub [email protected]
[email protected] ' s password:
Now try logging to the machine, with―ssh. Remote-host ' ‖, and check in:
. Ssh/authorized_keys to make sure we haven ' t added extra keys, you weren ' t expecting.
[Note: Ssh-copy-id appends the key to the. Ssh/authorized_key on the remote host.]
Step 3: Log in directly to the remote host
[Email protected]$ ssh remote-host
Last Login:sun-17:22:33 from 192.168.1.2
[Note: SSH does not ask for a password.]
[Email protected]$
Article III, some of the information you added
When adding your own Linux client to winsshd under Windows, a total of two points were added:
1, Open easy setings->windows accounts, add, administrator user->public keys imported->import, id_ Rsa.pub on the line//actually only need to add this one can be
2, Open easy seting->virtual accounts->add-Administrator user->public keys imported->import-Id_rsa . pub on the line
Add Id_rsa.pub in Winsshd to enable Windows Server host to automatically trust Linux clients