Find the answer to your Linux question:
Results 1 to 8 of 8
i don`t want to change it i want to see it.... thank you....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! dolgov's Avatar
    Join Date
    Nov 2007
    Posts
    49

    i am root, how can i see a user`s password?


    i don`t want to change it i want to see it.... thank you.

  2. #2
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    i don't think you can!
    Linux is not only an operating system, it's a philosophy.
    Archost.

  3. #3
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,132
    You shouldn't be able to see it, but you can reset it. The only way to see it would be to extract the password hash and brute force it with something like john the ripper. It's a lot of trouble to go to - the idea of encrypting the password is so no one can see including root.

  4. #4
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    Quote Originally Posted by bigtomrodney View Post
    the idea of encrypting the password is so no one can see including root
    In addition a good encryption shouldn't recursive or at least we don't know yet an algorithm to decrypt.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  5. #5
    Just Joined! dolgov's Avatar
    Join Date
    Nov 2007
    Posts
    49
    Quote Originally Posted by bigtomrodney View Post
    You shouldn't be able to see it, but you can reset it. The only way to see it would be to extract the password hash and brute force it with something like john the ripper. It's a lot of trouble to go to - the idea of encrypting the password is so no one can see including root.

    It`s like chineese but i got the idea. thank you and the one above.

    one more question : how do i add a user with password.

    cause when i am trying to :
    # useradd -p [userpassword] [username]
    it doesnt work out...

  6. #6
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    define the user and all the required option for it ( groups, login shell ) then change it's password using passwd (user_name), i think the option -p password will not work!
    Linux is not only an operating system, it's a philosophy.
    Archost.

  7. #7
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Quote Originally Posted by dolgov View Post
    cause when i am trying to :
    # useradd -p [userpassword] [username]
    it doesnt work out...
    Try adding a user with:
    Code:
    #useradd -m -s /bin/bash username
    #passwd -f username
    Then set the temporary password to whatever you want. The next time that user logs in, they will be asked to change their password. Or, you can take out the -f option and the password will not be expired (it will stay as whatever you set it to).

  8. #8
    Just Joined!
    Join Date
    May 2011
    Posts
    4

    Smile adduser with option -p

    Your password is always encrypted before it is saved.
    When you login, the password you type will also be encrypted and compared with the password in /etc/shadow.

    So when you use:
    Code:
    sudo adduser USERNAME -p PASSWORD
    Your password will be saved in /etc/shadow in PLAIN text
    Therefore, you will (almost) never can login with your password as it will be ENCRYPTED and compared with your PLAIN password.

    And here is the solution
    Code:
    pass=$(mkpasswd -m SHA-512 YOURPASS) // Assign encrypted password to variable $pass
    sudo adduser USERNAME -p $pass
    (You can also change encyption SHA-512 with MD5 method)
    Good luck!

Posting Permissions

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