By J. Kroeker
Hello all,
I’m trying to get multiple SSH keys to work for different server users, but from the same local machine.
Here’s the rundown of what I’ve done so far:
I have two user accounts on the server, one for system administration, and another one that I want to use for general website management through SFTP (does not have access to ‘sudo’ group).
I created SSH keys for both; added them to both my config file, and the authorized_keys file.
I can log in to my first, default account just fine, but connecting with the second one simply returns permission denied (publickey)
According to the debug output during connection, it finds the second key just fine, but for whatever reason refuses to use it. Shown below is what my local ssh_config file looks like.
Is there a step I’m missing or something I’m not doing right? Any help would be sincerely appreciated.
Thanks very much!
Host kcom-siteadmin
User siteadmin
HostName [my website]
IdentityFile ~/.ssh/personal-web/siteadmin/id_rsa
Host kcom-sftp
User sftpadmin
HostName [my website]
IdentityFile ~/.ssh/personal-web/sftpadmin/id_rsa
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Figured it out: permissions for the authorized_keys file was borked for the second user. Rookie mistake.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.