0

This question already has an answer here:

I created a linux user using a script .Also i want the newly created user to access only certain folders in the (/ )root directory.For that i changed the permission of root directory to 0750. chmod -R 0750 /*

After that when i tried to login to the newly created user with login command i am getting cannot chdir to home directory '/home/newuser' cannot execute '/bin/bash ' :permission denied .

i changed the permission of /bin/ folder to 0777 ,also set /home/newuser / permission to 0777 .still i am unable to login .

Is it possible to login with the new root permission .

marked as duplicate by Scott, dr01, Archemar, Jeff Schaller, jimmij May 27 '16 at 9:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Not an exact duplicate, but the answer is probably the same: "My recommendation is to reinstall." – Scott May 27 '16 at 6:55
  • 1
    And obviously learn to stop trying to change permissions of everything blindly. – Julie Pelletier May 27 '16 at 6:56
0

I'm afraid you have to reinstall Linux. Unless, if you are lucky, you run Linux on a Virtual Machine. I had the same problem and found the answer in this particular case (running Linux on a VM). Here's the answer.

To avoid this annoying kind of problem, I would recommand you to add aliases in ~/.bashrc file :

# do not delete / or prompt if deleting more than 3 files at a time #
alias rm='rm -I --preserve-root'

# confirmation #
alias mv='mv -i'
alias cp='cp -i'
alias ln='ln -i'

# Parenting changing perms on / #
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'

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