I've SSHed successfully into a remote server and I'm trying to transfer some files between my local machine and the remote server using the SCP command.
When I try to transfer a file from the remote server to my machine while logged in the remote server I get a permission denied error:
alexa@server:~/project$ scp alexa@server:~/project/requirements.txt /mnt/c/Users/Alexa/Desktop/
alexa@server: Permission denied (publickey).
When I try to do the reverse and transfer a file from my local machine to the remote server while logged in my local machine I get this:
alexa@local:/mnt/c/Users/Alexa/Desktop/$ scp test_doc.txt alexa@server:~/project/
ssh: Could not resolve hostname server: Name or service not known
lost connection
I checked the permissions of all files and folders and alexa is the owner. Furthermore, I tried the same commands using sudo in front but the outcome was the same.
The debug shows this
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/alexa/.ssh/id_rsa
debug3: no such identity: /home/alexa/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_dsa
debug3: no such identity: /home/alexa/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_ecdsa
debug3: no such identity: /home/alexa/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_ecdsa_sk
debug3: no such identity: /home/alexa/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_ed25519
debug3: no such identity: /home/alexa/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_ed25519_sk
debug3: no such identity: /home/alexa/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /home/alexa/.ssh/id_xmss
debug3: no such identity: /home/alexa/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
alexa@server: Permission denied (publickey).
When I checked the content of /home/alexa/.ssh/ I only see 2 files:
alexa@server:~/.ssh$ ls -la
total 16
drwx------ 2 alexa alexa 4096 Jun 26 13:12 .
drwxr-xr-x 8 alexa alexa 4096 Apr 13 18:11 ..
-rw------- 1 alexa alexa 736 Apr 1 15:53 authorized_keys
-rw-r--r-- 1 alexa alexa 444 Jun 26 12:48 known_hosts
Any ideas what's causing this?