Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Adding new user - cannot connect via ssh (Permission denied) #145

Closed
AJMiller opened this issue Mar 9, 2017 · 7 comments
Closed

Adding new user - cannot connect via ssh (Permission denied) #145

AJMiller opened this issue Mar 9, 2017 · 7 comments

Comments

@AJMiller
Copy link

AJMiller commented Mar 9, 2017

So I followed the steps on https://github.com/carlalexander/debops-wordpress/wiki/How-to-manage-additional-users and added a new user called 'wordpress' for deployments. I added my ssh key and one from my deployment server to the array of keys. When I try to login as that user, I get a 'Permission denied' error. It looks like the user may have been added but when I run cat /etc/passwd the line for that user shows:

wordpress:x:997:992::/var/www/{mysiteurl.com is here}:/usr/sbin/nologin

Does that cause the user to not be able to login? This is a brand new DO droplet that just had debops-wordpress run on it. Server runs fine. I can ssh in as root just fine as well.

@carlalexander
Copy link
Owner

I still haven't updated the wiki for deployments yet. You don't need to create a user to configure thw wordpress user that way. You only need:

wordpress__user_allow_remote: true

@carlalexander
Copy link
Owner

You can refer to this comment for some more details.

@AJMiller
Copy link
Author

ok thanks @carlalexander! Tried that option, re-ran debops and still wasn't able to login with the ssh key I provided. I saw a pem file in the /secret folder, so I tried connecting with that, which asked for a password I don't have. Tried all of the generated passwords, but no luck there. Am I missing something?

@carlalexander
Copy link
Owner

carlalexander commented Mar 10, 2017 via email

@AJMiller
Copy link
Author

oh bummer. Ok thanks carl. Any way for me to include my own public key for the wordpress user? The deployment system we use generates its own keys and provides us with the public key.

@drybjed
Copy link

drybjed commented Mar 10, 2017

There's no need to recreate the host from scratch if you can connect to the host as the root user. Login to i and check the SSH log entries in /var/log/auth.log. Correct any issues manually and ensure that you can connect to your chosen account as usual.

@AJMiller
Copy link
Author

k thanks @drybjed! It looks like the ansible scripts aren't touching the authorized_keys file after it's initially created. For others who stumble across this: somehow my keys were already installed for the wordpress user so I was able to ssh [email protected] and it logged me in. I was then able to add the deployment server's public key to the ~/.ssh/authorized_keys file and the deployment server was able to log in to the wordpress user account without issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants