Quantcast
Viewing latest article 4
Browse Latest Browse All 5

scp'ing using key file as a parameter, How can I do that if possible?

scp -i ~/.ssh/id_rsa.pub events*$date*_QA.log $remote_user@$remote_server:$remote_location

Is the aforementioned script incorrect? Am I not doing it correctly?

I went to the .ssh directory and saw that the remote server is in the known_hosts file.

But, when I do ordinary scp without any file as parameter, it is still asking for password

scp events*$date*_QA.log $remote_user@$remote_server:$remote_location

How can I include the key file in my command?

sh-3.2$ grep server ~/.ssh/*
/home/user/.ssh/known_hosts:server....com,ip_addr ssh-rsa Asine=jhjsdhfjsadhfjkashdfjhasdjfhksadjfhasjdfhj

Viewing latest article 4
Browse Latest Browse All 5

Trending Articles