আপনার যা দরকার তা হ'ল ক্রস প্ল্যাটফর্ম ssh
কমান্ডলাইন সরঞ্জামগুলি, ssh-keygen
এবং ssh-copy-id
। উইন্ডোজ জন্য গিট তাদের অন্তর্ভুক্ত।
হয় গিট-ইনস্টল bash
শেল থেকে এটি করুন :
#By default this puts keyfile pair in ~/.ssh/id_rsa & ~/.ssh/id_rsa.pub :
ssh-keygen.exe -t rsa -b 2048
ssh-copy-id -i ~/.ssh/id_rsa.pub $remoteuser@$remotehost
# These two chmod lines are needed on unix platforms, probably not on Windows.
# typically ssh refuses to use a private key file
# if it is less-well protected than this:
chmod 700 ~/.ssh
chmod 640 ~/.ssh/id_rsa
অথবা এই স্ক্রিপ্টটি পাওয়ারশেলে চালান:
Param(
[Parameter()][string]$keyfile="id_rsa",
[Parameter()][string]$remotehost,
[Parameter()][string]$remoteuser
)
write-host "# ---------------------------------------------------------------------------------#"
write-host "# Create an RSA public/private key pair, and copy the public key to remote server #"
write-host "# #"
write-host "# /superuser/96051 #"
write-host "# ssh-from-windows-to-linux-without-entering-a-password/1194805#1194805 #"
write-host "# #"
write-host "# ---------------------------------------------------------------------------------#"
write-host "Keyfile pair will be saved at : ~/.ssh/$keyfile, ~/.ssh/$keyfile.pub"
write-host "And copied to $remoteuser@$remotehost"
write-host ""
write-host "You will need a password for the copy operation."
write-host ""
if( -not $(ls ~/.ssh) ) { mkdir ~/.ssh }
$sshdir=$(get-item ~/.ssh/).Fullname
#By default this puts keyfile pair in ~/.ssh/id_rsa & ~/.ssh/id_rsa.pub :
ssh-keygen.exe -t rsa -b 2048 -f "$sshdir$keyfile"
# ssh-copy-id somehow didn't work in Powershell so I called it via bash
bash -c "ssh-copy-id -i ~/.ssh/$keyfile.pub $remoteuser@$remotehost"
# I'm not sure if these two chmod lines work on windows but
# typically ssh refuses to use a private key file
# if it is less-well protected than this:
chmod.exe 700 $sshdir
chmod.exe 640 "$sshdir$keyfile"
এর পরে, পাসওয়ার্ডহীন লগইন ssh
এবং উভয়ের জন্যই কাজ করা উচিত scp
।