scp user@ServerB:/home/user/test.txt /home/user/
However, it always prompt for password, which is very bad for scripting.
YES! There is some solution, i.e. to be authorized in the destination server. Here is step-to-step procedures to achieve this:
1. Generate public/private key pairs in home/user/.ssh in Server A:
ssh-keygen -t rsa
2. Copy id_rsa.pub in Server A to home/user/.ssh/authorized_keys2 in Server B:
scp .ssh/id_rsa.pub user@ServerB:/home/user/.ssh/authorized_keys2
The system will prompt for user password at this stage.
Note: The destination file should be authorized_keys for SSH protocol version 1, or authorized_keys2 for SSH protocol version 2.
3. Make sure that permissions for .ssh directory in both servers are set to 700.
- To view permission
ls -ld .ssh
- To change permission
chmod 700 .ssh
Done! Now SCP won't prompt password again during file copy.
For more command about file transfer using Linux or Unix, e.g. ftp, sftp, wget etc., you may visit http://aruljohn.com/info/filetransfer/
Code for sync files:
ReplyDeletersync -avz -e ssh user@ServerB:/home/user/folder/ /home/user/folder/
or
rsync -avz -e ssh user@ServerB:/home/user/folder/*.txt /home/user/folder/
I got what you mean , thanks for posting .Woh I am happy to find this website through google. Folder Lock PC App Gallery - Don't Waste Time Looking, Study Information On PC Devices Right here how to password protect my photo album ipad
ReplyDeleteI want to thank you for this excellent read!! I certainly loved every little bit of it. I've got you saved as a favorite to check out new things you post…
ReplyDeleteImportant site: Top Encryption Software Guide! & How To Learn To How To Encrypt A Password For Free Just 10 Minutes A Day
I am glad that I saw this post. It is informative blog for us and we need this type of blog thanks for share this blog, Keep posting such instructional blogs and I am looking forward for your future posts.
ReplyDeleteCyber Security Projects for Final Year
JavaScript Training in Chennai
Project Centers in Chennai
JavaScript Training in Chennai
thanks admin good post marsbahis
ReplyDeletetrendbet
galabet
maltcasino
marsbahis
trendbet
maltcasino
galabet
yeni perde modelleri
ReplyDeleteNumara onay
mobil ödeme bozdurma
nft nasıl alınır
Ankara evden eve nakliyat
Trafik sigortasi
dedektör
web sitesi kurma
aşk kitapları
SMM PANEL
ReplyDeleteSmm panel
İş İlanları
instagram takipçi satın al
hırdavat
Www.beyazesyateknikservisi.com.tr
Servis
Jeton hilesi