0

I am attempting to transfer a tarball from my Oracle Cloud VM to my local machine, when I try it says:

remote_username@ip_address: Permission denied(publickey)

Since I guessed this was my publickey refusing to allow this due to an issue with permissions I located the authorised_keys file in my VM on the assumption this would hold my public key but when I try to change the permissions it says:

chmod: cannot access '/home/remote_username/.ssh/authorised_keys': No such file or directory

it appears to think the file I am trying to change permissions for does not exist despite the fact that the file clearly exists, the VM for whatever reason does not recognize it's existence and I'm not sure how to get it to realize there is in-fact a file there that can have it's permissions altered so that I can actually transfer files from my VM to my local machine.

  • Normally the authorized_keys file is in /home/<username>/.ssh/. Why is this not the case on your system? I don't understand head or tail of your question. – vidarlo Feb 20 '23 at 20:56
  • I just discovered the .ssh folder you mentioned just now there, I had forgotten to tell the VM to list all files including dot ones, I suspect I won't be having an issue for much longer. – oraclewoes Feb 20 '23 at 21:00
  • Ok, here's the problem I'm having since it's not fixed, I am trying to modify permissions because I suspect the file doesn't have permissions set such that I can transfer files from my VM to my local machine, I just located the authorized_keys file in /home/username/.ssh/ when attempting to change the permissions I get this error:

    chmod: cannot access '/home/remote_username/.ssh/authorised_keys': No such file or directory

    despite the file clearly being right there, it doesn't seem to recognize the existence of this file and I don't know why

    – oraclewoes Feb 20 '23 at 21:02
  • Are you typing authorized_keys or authorised_keys ? You have spelled it 2 different ways in your comment – steeldriver Feb 20 '23 at 21:09
  • Ok that was the problem, however I still get the following error when attempting to scp my tarball file from my VM to my local machine:

    remote_username@ip_address: Permission denied(publickey)

    – oraclewoes Feb 20 '23 at 21:14
  • Usually, Permission denied(publickey) is not a file permission problem. It's usually an ssh configuration problem. It means your login is refused because your client system presented the wrong key. – user535733 Feb 20 '23 at 21:21
  • I see, what should I do to ensure the correct key is presented? Also, by client system I assume you mean the VM not the local machine or is this to do with needing the correct private key to read from the local machine, apologies if what I'm asking doesn't make much sense, I'm still quite new to handling servers and CLIs and am figuring things out as I go and asking for help from more knowledgeable people as well – oraclewoes Feb 20 '23 at 21:25
  • Please read for instance this q&a. I have no idea what your setup or problem is. – vidarlo Feb 20 '23 at 21:37
  • Ok I've read that and I already have my permissions for my public key set up correctly, my setup is an instance on Oracle Cloud using Ubuntu 20.04 as the image, I use a keypair generated by Oracle Cloud when I created the instance to SSH from my local machine onto the instance, the private key is on my local machine, the public key is on my instance, I want to scp a tarball file I created on my instance from the instance to my local machine however when I attempt this it says : remote_username@ip_address: Permission denied (publickey), I hope this helps explain it – oraclewoes Feb 20 '23 at 21:45

0 Answers0