I want to copy a file from source machine A to destination machine B, using command and want to use ftp.
I tried this
scp /home/varun/Desktop/Test.java username_for_target_machine@ip_address_of_target_machine:/home/Desktop/ The authenticity of host 'ip_address_of_target_machine (ip_address_of_target_machine)' can't be established. RSA key fingerprint is 4a:49:cc:9d:ab:f6:ec:4f:b2:0b:63:ef:8f:b8:76:76. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ip_address_of_target_machine' (RSA) to the list of known hosts. qaserve@ip_address_of_target_machine's password:
When I give password for target machine
Permission denied, please try again.
I tried multiple time but I get the same output.
- Where am I making a mistake?
- How can I give a username and password in command so that it wont ask password?
I tried using ssh. bellow are the steps what I followed.
1. Verify that local-host and remote-host is running openSSH
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
2. Generate key-pair on the local-host using ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/jsmith/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/jsmith/.ssh/id_rsa. Your public key has been saved in /home/jsmith/.ssh/id_rsa.pub. The key fingerprint is: 31:3a:5d:dc:bc:81:81:71:be:31:2b:11:b8:e8:39:a0 jsmith@local-host
3. Install public key on the remote-host.
[remote-host]$ vi ~/.ssh/authorized_keys ssh-rsa ABIwAAAQEAzRPh9rWfjZ1+7Q369zsBEa7wS1RxzWR jsmith@local-host
4. Give appropriate permission to the .ssh directory on the remote-host.
[remote-host]$ chmod 755 ~/.ssh [remote-host]$ chmod 644 ~/.ssh/authorized_keys
5. Login from the local-host to remote-host using the SSH key authentication to verify whether it works properly.
[local-host]$ ssh -l jsmith remote-host
When I run the above command I get:
ssh: connect to host remote-host port 22: Connection timed out
When I type
ssh -l ipaddress_of_remote-host remote-host
Its asking for a password : when I provide the password, it connects to the remote_host.
Why is it asking for a password again after I have registered the public key in the remote host?
Update 2: Sorry for mess.
I want to copy file from source to destination using any protocol. change the permission
[remote-host]$ chmod 700 ~/.ssh [remote-host]$ chmod 600 ~/.ssh/authorized_key