Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I wanted to login as a user, but when I typed in login usr (usr is just a placeholder for the user name) the system returned:

login: Cannot possibly work without effective root. 

How can I fix this?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You can make the login command succeed by running it as root (as the error message says).

You can run login username as root by using sudo:

sudo login username

Unless you've very recently run a command with sudo in the shell you're already in, you'll first be prompted to enter your password as an administrator who is able to run commands as root with sudo.

Then the login command will run, it will prompt for username's password, and if the password is successfully entered, you'll get a login as username.

However, you probably do not need a real login as username:

  • To start a login shell as username, run:

    sudo -i -u username

    This requires no authentication except for the initial sudo authentication (when you enter your password, not username's password). Only administrators can do this.

  • To start a login shell as username, such that you are prompted for username's password (and not prompted for your own password), run:

    su - username

    Any user (except Guest) can do this, provided that they know username's password.

For more information about running commands as root, see the community documentation.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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