Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
Hi, I once disabled my login password, and now I would like to set a password again by using the terminal. So, in the terminal I write: sudo passwd myuser ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    9

    setting password after disabling it

    Hi,

    I once disabled my login password, and now I would like to set a password again by using the terminal.

    So, in the terminal I write:

    sudo passwd myuser

    I'm asked for my current password, but since I don't have one I press enter.
    I get: Sorry,try again....

    What's the correct way of doing this?

    Thanks.

  2. #2
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    119
    Try using "su" or logging on as root and then using the "passwd myuser"

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    9
    "su" gives the same results as sudo, and I understand that logging in as root is a pain...

    Isn't there a simple solution to this?

  4. #4
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    855
    So, in the terminal I write:

    sudo passwd myuser
    You do not need to be root, use just plain passwd command from your user terminal.

  5. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    passwd won't work afaik when there is no password specified for the "current password" part of changing your password

    running with sudo or as root will fix this, if you can't gain access to either of these, you should be able to boot into single user mode and set your password there

    How to reset your password in Ubuntu

  6. #6
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    119
    Quote Originally Posted by Segfault View Post
    You do not need to be root, use just plain passwd command from your user terminal.
    Except he cannot logon as that user because the account is disabled.


    OP, how did you disable the account?

  7. #7
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    855
    OP didn't say he disabled his account, he disabled the password associated with his account. su requires user password, if it does not exist it won't work.

  8. #8
    Just Joined!
    Join Date
    Aug 2010
    Posts
    9
    Quote Originally Posted by Segfault View Post
    You do not need to be root, use just plain passwd command from your user terminal.

    Yeah, that solved the problem.

    Although btw, deleting a password did require the use of sudo.

  9. #9
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    OP said "login password". Are we talking about just when you login to your desktop, ie, at the login display when you put in your username and password? In which case the passwd command has nothing to do with it.

    EDIT: Slow on the draw and I guess not.

  10. #10
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    119
    Quote Originally Posted by Segfault View Post
    OP didn't say he disabled his account, he disabled the password associated with his account. su requires user password, if it does not exist it won't work.
    My apologies, I meant to use su to go to root, then change the passwd with "passwd myuser" which does not require the old password.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...