Score:0

How can i regain access to my files on my server

in flag

I switched user after creating a user on my server from root, I then blocked root log in, shortly after during my setup I wanted to push to github but the ssh public key permission was denied, I then tried to change permissions to allow mw have access here is what I got

`chmod go-rx bal`
`chmod: changing permissions of 'bal': Operation not permitted`

I used super user do nothing still happened, it brought the same error. I then wanted to switch user but I was unable to here is what happened

`su root`
`Password:`
`su: Authentication failure`

This is the error I got when I tried pushing to github, which is why I started trying to change my user permissions:

`/var/www/app$ sudo git push origin master`
`[email protected]: Permission denied (publickey).`
`fatal: Could not read from remote repository.`

`Please make sure you have the correct access rights`
`and the repository exists.`

Help me on this too Currently now I can't even login to my server again using my user and root after I changed my /.ssh files permission to a+rwx

this is the error I get when i try to login to my server now

`ssh [email protected]`
`[email protected]: Permission denied (publickey).`

Please help me to regain full access to my files and I didn't remember given my root any password except the new user I created. Please help me it's my final year project and I'm to submit by the end of this month.

Nmath avatar
ng flag
is your user added to sudoers? do you know your password?
Abayomi Usman avatar
in flag
yes i know my password but i don't know if i'm added to sudo doers
Abayomi Usman avatar
in flag
infact my user doeas not have sudo priviledges and i've blocked myself from root login
Abayomi Usman avatar
in flag
i tried showing my origin url using `git remote show origin` i got the same error i got while trying to change permissions and i've disabled root login to my server i'm so perplexed
pLumo avatar
in flag
If you run `su root`, it asks for `root` password, which is not set by default. You want `sudo su -` or simply `sudo -i`. Private keys in `.ssh` need permission 600.
Abayomi Usman avatar
in flag
i don't understand please explain further
Abayomi Usman avatar
in flag
right now i can no longer communicate with my server
Abayomi Usman avatar
in flag
how do i do this now if i run sudo -i on my remote system, would i be able to login on my server again?
pLumo avatar
in flag
Ask the support to fix the permissions of files in `.ssh`. Nothing we can do. The provider might have web-based ssh-interface where you can possibly log in.
Abayomi Usman avatar
in flag
you mean ubuntu support?
Abayomi Usman avatar
in flag
or my hosting company support
pLumo avatar
in flag
your hosting company.
Abayomi Usman avatar
in flag
ok thank you very much
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.