Access trough ssh as a root
Pergunta
I have a virtual machine with ssh access. Previously I logged in trough ssh as a root, but I tried to configure ssh access for users group. I followed the following tutorial: http://knowledgelayer.softlayer.com/learning/how-do-i-permit-specific-users-ssh-access
I have created group "sshusers" and added "my-user" to "sshusers" group. Then I added the following entry to /etc/ssh/sshd_config:
AllowGroups sshusers
Unfortunately I forgot to add "my-user" to sudoers.
Now I cannot login as root (since he is not in "sshusers" group) and I can not fix the configuration as a "my-user" (since he is not in sudoers).
Is it possible to fix this issue without having to reinstall system... ?
Solução
If you have SSH access you can type the follwing
su - [enter]
This will ask for the root password, typ it in and then you are a root user.
After that you can add you user to the sudoers group.