![]() ![]() The basic idea is to create a key pair on the client and copy the public key to the server into an authorized keys file. To avoid this, or to automate file copying in scripts, public key authentication is usually used. make sure the key file should have permission 600 or 400. ![]() Assume your case for scp from 192.168.1.1 try below command. for planet in mercury venus earth mars pluto do ssh '/home/al/backup/mysql-bu.sh' ssh '/home/al/backup/html-bu.sh' scp scp -r -o 'ForwardAgent=yes' /Users/pengge/11.vim If you have a SSH key with access to the destination server and the source server does not, adding -o 'ForwardAgent=yes' will allow you to forward your SSH agent to the source server so that it can use your SSH key to connect. It'll then generate an identification (private key) and a public key. is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy! On host_src, run this command as the user that runs scp/ssh/rsync. Subsequent public keys can be appended to this file, much like the ~/.ssh/known_hosts file. The destination for your public key is on the remote server, in the following file: ~/.ssh/authorized_keys2. The next step is to copy the public key file to your remote computer. See, the source server does not know the destination server and it can't ask you to confirm the identity, since you don't have a terminal open there: debug1: read_passphrase: can't open /dev/tty: No such device or address Host key verification failed. Login to the server S, you need to append your public key to your authorized_keys file: This is very easy to fix. If ssh-copy-id is not available on your machine (it is newish), you will need to do this by hand: Copy your public key from your workstation into your HOME directory on the remote machine: W$ scp ~/.ssh/id_dsa.pub S.ssh/id_. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |