Score:0

Can't transfer tarball from VM to local machine

ch flag

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.

vidarlo avatar
om flag
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.
oraclewoes avatar
ch flag
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 avatar
ch flag
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
hr flag
Are you typing `authorized_keys` or `authorised_keys` ? You have spelled it 2 different ways in your comment
oraclewoes avatar
ch flag
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)
user535733 avatar
cn flag
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.
oraclewoes avatar
ch flag
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
vidarlo avatar
om flag
Please read for instance [this q&a](https://askubuntu.com/questions/46424/how-do-i-add-ssh-keys-to-authorized-keys-file). I have no idea what your setup or problem is.
oraclewoes avatar
ch flag
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
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.