zhaoyatao.com
Secure Shell(SSH)
// windows 11 users want to use ssh in cmd's windows, you need to add an optional feature: OpenSSH Client
// step by strp, this note will help you setting up a ssh connection. whatever a diratory in your local client (windows11)
// run cmd.exe:
ssh-keygen
// copy file to linux server
// note: remove my folder: C:\Users\Administrator\.ssh>
C:\Users\Administrator\.ssh>scp windows11_id_rsa.pub root@xx.xxx.x.xx:~/.ssh
// login your server with password this time
ssh root@xx.xxx.x.xx
// get into your server's .ssh folder
cd .ssh
//copy public key file to the configuration file of ssh
cat windows11_id_rsa.pub >> authorized_keys
// login your server with private key
ssh root@xx.xxx.x.xx -i "C:\Users\Administrator\.ssh\windows11_id_rsa"
// note: use private key as password to login your server with public key
// server use your public key to encrypt data, so you use private key open it.
done
one more thing:
// create a file: root.bat
// run it, login, without password and '-i "C:\Users\Administrator\.ssh\windows11_id_rsa" '
ssh-add windows11_id_rsa
ssh root@xxx.xx.x.xx