Question
How can i getback access to the root?
I added a user and gave all the privileges to user by following a digital oceans tutorial. But i want to access the rails folder which has been created in the root directory. How can i get the access of root again?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Have you tried logging in as root?
Yes , it not allowing me to login to the root from my mac terminal. but i can login to root from console access in digital ocean. But I want to login to root via mac terminal.
Hey! Could you provide a bit more information? What was the tutorial that you followed? It sounds like you disabled root from being able to log in via SSH? Did you add
PermitRootLogin no
to the file/etc/ssh/sshd_config
? If so, you can just change that back to yes and restart ssh.Yes, I changed PermitRootLogin to no. And yes, I tried to change it back to yes but then reload ssh shows this msg-
reload: Rejected send message, 1 matched rules; type=“methodcall”, sender=“:1.133” (uid=1001 pid=4882 comm=“reload ssh ”) interface=“com.ubuntu.Upstart06.Instance” member=“Reload” error name=“(unset)” requestedreply=“0” destination=“com.ubuntu.Upstart” (uid=0 pid=1 comm=“/sbin/init ”)
As u said after saving it to yes i tried restart ssh aslo, its showing the same msg-
restart: Rejected send message, 1 matched rules; type=“methodcall”, sender=“:1.134” (uid=1001 pid=4883 comm=“restart ssh ”) interface=“com.ubuntu.Upstart06.Job” member=“Restart” error name=“(unset)” requestedreply=“0” destination=“com.ubuntu.Upstart” (uid=0 pid=1 comm=“/sbin/init ”)
@anishajayan It looks like you are trying to restart it as the non-root user. In that case, you’ll need to use sudo:
when i did sudo service ssh restart, it display- “ssh stop/waiting
ssh start/running, process 27591” . Then i tried logging into root by - “ssh root@ip_address” ,its displaying- “Permission denied, please try again.” I used the same password in digital ocean console, and it logged me in there.But in mac terminal its displaying the above msg.
I removed AllowUsers line from sshd_config file and now I can access the root again.