SSH Permission denied (publickey) DigitalOcean Ubuntu [closed] - ssh

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I can't seem to log in to my droplet on digitalocean.
When I try ssh root#162.243.123.123 I get a Permission denied (publickey). I tried resetting the root password and logging in via the digitalocean droplet console, but it won't take the root login or password that was reset. Nor will it take the other username and password that I set up.
Everything was working fine yesterday, but when I started work today I ran into the Permission denied issue. So I'm not sure what changed to make this no longer work. I also checked my github keys to see if it hadn't been added, but my local machines key is there and correct. I've also tried adding the key to the droplet with ssh-copy-id admin#162.243.123.123, but got the same error.
Looking at the keys found when logging into the digitalocean website shows the correct key.

The issue was on the server-side authorized_keys, but not the ~/.ssh/authorized_keys. It was in a separate /home/user/.ssh/authorized_keys file, where I had to add the ssh-keys. Once I did this the issue went away. Not sure how it got removed from that file since I hadn't modified it.
This video helped.

Related

how to setup ssh and "ssh_config" file correctly [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I have noticed while learning how to setup ssh that lots of stackoverflow posts referred to the file ssh config being inside of the folder ~/.ssh but when i look at the same folder in my macbook the files listed are:
created from my last ssh setup
someprivatekey
someprivatekey.pub
known_hosts
now when i inspect the folder cd /etc/ssh/ then i can see the file ssh_config there.
Is it a normal behavior or should ssh file "ssh_config" always be located in "~/.ssh" folder and I have presumably a wrong configuration?
(Sorry if the post sound very elementary, i am learning how to use ssh)
how to should i setup ssh and the "ssh_config" file correctly?
The file in /etc/ssh affects all users on the machine, while the one in ~/.ssh affects only you. You can find a complete list of the file locations at the end of the ssh manpage (which should be available at your computer by running man ssh).

Unkown permission issues preventing wsl2 from accessing random windows files/directories [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm having permissions issues when accessing seemingly random directories/files on the windows filesystem with wsl2/ubuntu. Some directories are not accessible and I get a 'permission denied' error when I try to access them or any of the files in them. However, I have no issues accessing them from Windows itself through explorer or a non-admin powershell or command-line shell.
From the WSL side I am the owner of the files and directories and have correct permissions but I still cannot access them. I can however access these directories/files if I switch to root. I shouldn't have to though since the permissions on this directory are the same as the ones on other directores.
drwxr-xr-x me me
I've tried looking at the directory properties from the Windows side and making them more permissive ("Full-control" to each group in the properties>security menu) to all of the various groups with no success. I am the only user of this computer and the only groups that exist are...
Authenticated Users
SYSTEM
Administrators (${my-machine-name}\Administrators)
Users (${my-machine-name}\Users)
I can provide more info if needed.
Make sure that not only the directory that contains the files has rx for your WSL user but also every directory above it (Sorry, would have commented but I don't have enough rep yet).
Try creating a /etc/wsl.conf with the following:
[automount]
options="metadata,uid=1000,gid=1000,umask=022"
After creating the file:
Exit your WSL session
wsl --terminate <distro> or wsl --shutdown
Then restart and test the file/directory permissions again.
The uid and gid probably already default to those values since you mention that the files and directories on the NTFS drive are showing as owned by your user. So they can probably be left out.
The metadata option is important, as it allows WSL to map Linux permissions on to files and directories created in WSL on those NTFS drivers. But again, this isn't really your problem here either.
The umask is hopefully the long-term answer to your problem, as it will map WSL/Linux rwxr-xr-x to directories created in Windows, and rw-r–r– to files.

Warning: Identity file not accessible: No such file or directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I currently have access to a supercomputer cluster.
The problem starts when I enter.
When I try to perform the following command line ssh -i user # extension, I get the following error
Warning: Identity file user # extension not accessible: No such file or directory.
I have tried testing the public root key and if it recognizes it, instead when I run in /home/user, I get the error.
I've been trying some permission changes with the chmod command and I can't get a solution.
ssh -i is to reference a private ssh key.
So if you have a key pair named user.rsa/user, that might work.
But in your case, "user" is not the name of the key, but simply the remote user you want to open a secure shell with on the remote server
ssh user#remoteServer
You don't need -i, if you have a default id_rsa/id_rsa.pub key pair in your local ~/.ssh

SSHing in to EC2 Ubuntu instance with user ubuntu tells me to login as ubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm having an issue where I try to SSH into my API server (EC2 instance running Ubuntu). I've been SSH'ing in just fine for the past few weeks, but I suspect I messed something up because now it tells me to login as user ubuntu (I am!) :
% ssh ubuntu#ec2-50-17-143-255.compute-1.amazonaws.com -i ~/dev/key.pem
Please login as the user "ubuntu" rather than the user "root".
Is there something I could have done to mess with the ubuntu user? Is there anyway to resolve this without having to save the AMI and boot up a new instance?
Please use ssh -v ... or ssh -vv ... to see what is going on.
In your case it looks like you copied ~root/.ssh/authorized_keys to ~ubuntu/.ssh/.
According to this, the root account is configured to reject logins with this message using the authorized_keys file. If you copied this file, now the user ubuntu will reject logins with this key, too...

scp error when copying files [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am trying to use the scp command but I'm getting the following error:
permission denied
lost connection
I get this when I use scp to copy a file from a master node to a slave node.
This is probably more like your error, ya?
Permission denied (publickey).
lost connection
The simplest problem is that you don't have permissions to access the directories specified on at least one end of the copy operation, or you may just have a bad login.
You could try using sudo chown -R
*username* to make sure you have rights to the target directories on
both ends.
Check your directory specifications, make sure that you are using ~/Documents for instance instead of /Documents. Very different locations.
If you've got a bad login, I can't help you there, sorry. Try just ssh-ing into the target(s) make sure you can.
You could check out the manpage for more help
I think error in giving permission to folder which has the authorized_keys file
use chmod and set the permissions