Is there any possibility to create one master account (for one master laptop for example), from which I can log in to all accounts available on the server ?

My server has Keys Authentication enabled and PasswordAuthentication disabled.

Now, after reboot I can login to server from my (master laptop) as root, but I can not login as a regular user, I get „access denied".


Yes, but you will first need to log in as the master or root account, and then sudo su otheruser in order to log in as that user. There is no way to log in as any user without first going through a privleged user's account.

An additional caveat is that the user you are trying to log in as needs to have a shell of /bin/bash or similar valid shell in /etc/passwd. If the user has a shell like /bin/fase or /bin/nologin you will be unable to change to this user's account (but neither will anyone else for that matter).


edit your /etc/ssh/sshd_config and add

AuthorizedKeysFile    /etc/ssh/all_users_authorized_keys

Put your pubkey in that file, and restart the sshd.

See: https://www.ssh.com/ssh/authorized_keys/openssh

The default behavior (which we are all probably familiar with) is

AuthorizedKeysFile    %h/.ssh/authorized_keys

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.