After a fresh Ubuntu Mini CLI install, nothing has permission to do anything. ssh-keygen can't create a directory for id_rsa.pub, git can't do anything without sudo, etc.

I can read most files, but making directories and reading to some files requires sudo.

How do I fix this?

Edit: I think it helps to mention I'm using the default admin account created by the command line installer.

  • Please, paste the output of: whoami && ls -ld $HOME – Daniel Jul 12 '16 at 17:13
  • dr-x------ 4 logandark logandark 4096 Jul 12 09:23 /home/logandark – Dev Jul 12 '16 at 17:15

The permissions on your $HOME directory are incorrect. You can fix it by typing chmod u+w $HOME.

Notice that the files and directories you created using sudo are probably owned by root now, so, you will need to fix ownership on these. You can do it by using sudo chown logandark.logandark <file or directory name>.

EDIT: To change ownership recursivelly, add the -R option to chown, like chown -R logandark.logandark .git. Be very careful when doing stuff recursivelly.

  • After using sudo chown logandark.logandark -R $HOME I still can't use git fetch – Dev Jul 12 '16 at 17:49
  • Actually, forgot the -R. – Dev Jul 12 '16 at 17:49

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.