Article Title: OpenSSH implements secure transmission in Windows and Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Secure File Transfer in Windows and Linux using OpenSSH
Considering the secure transmission of files between windows and linux systems, we are ready to use ssh. OpenSSH is free of charge for windows and linux systems.
In this example, use windows (ip: 192.168.1.25) as the client and linux (ip: 192.168.1.26) as the server. Install the ssh service in linux.
1. Download OpenSSH: http://sshwindows.sourceforge.net/and install. The default installation directory is C: \ Program Files \ OpenSSH.
2. Modify/home (root directory) in the Registry
[HKEY_LOCAL_MACHINE \ SOFTWARE \ Cygnus Solutions \ Cygwin \ mounts v2 \/home]
"Native" = "C: \ Program Files \ OpenSSH \ home"
3. Create the home and username directories under C: \ Program Files \ OpenSSH.
Cd C: \ Program Files \ OpenSSH
Mkdir home
Mkdir home \ Administrator
Mkdir home \ Administrator \. ssh
4. Generate a key
Cd C: \ Program Files \ OpenSSH \ bin
Ssh-keygen.exe d
Generate two Files in the C: \ Program Files \ OpenSSH \ home \ Administrator \. ssh directory
Id_dsa and id_dsa.pub, suffix. Pub is the public key.
5. Copy id-dsa.pub to linux server, can be copied through winscp, is a good windows client tool.
6. Run the command on the linux Server
Cat ~ /. Ssh/id_dsa.pub> authorized_keys
7. Modify the sshd configuration file
Vi/etc/ssh/sshd_config
Set
# PubkeyAuthentication yes
# AuthorizedKeysFile. ssh/authorized_keys
To verify the user identity using the authorized_keys file.
8. Restart the sshd service.
# Service sshd restart
9. Use scp and ssh in windows to log on and copy files. You do not need to enter a password to implement secure file transmission.
> Ssh.exe root@192.168.1.26 # login to the linux Server
> Scp.exe somefile root@192.168.1.26:/root/# copy the file.