On Tue, Nov 4, 2008 at 10:29 AM, linuxonbute <[EMAIL PROTECTED]>wrote:

>
> Reboot and at the grub menu ( press ESC key if it doesn't appear )
> select recovery mode
>
> This will put you into single user mode, logged in as root - without
> needing to enter a password.
>
> If you know the user name then issue this command to change that users
> password :
>
> passwd theusername
>
> reboot and there you go.
>
> If you cannot remember the user name then you will have to look in the
> file /etc/passwd to see it.
>
> best wishes,
> Norman
>
>
> -~----------~----~----~----~------~----~------~--~---
>
>
I believe that to set another user's password, you will have to preface the
"passwd" command with "sudo," and if it is a one person system (only one
user login account), then you will need to know the password that you are
trying to reset in order to reset it.

The file /etc/passwd DOES NOT list user passwords. You will not be able to
see a user's password by opening this file. It lists account names with user
and group numbers for each, the account's home directory, plus the default
shell (generally /bin/bash or /bin/sh) that each run under. If you issue the
command "getent passwd" from a terminal screen, the contents of /etc/passwd
will be displayed on the screen.

Here's an example from /etc/passwd...

man:x:6:12:man:/var/cache/man:/bin/sh

In the above, "man" refers to the account; "x" tells you that this account
has an encrypted password stored in /etc/shadow; the "6" and the "12" are
user and group ID's respectively; "man" describes user ID info;
"/var/cache/man" is the absolute path to the account's Home directory;
finally "/bin/sh" is the absolute path to the account's command shell. This
format is the same for user accounts on the machine.

As noted above, it is /etc/shadow where *encrypted* passwords are kept. This
will not do you much good, since it is not displayed in a format that is
easily understandable, and you need su level access to even open it
(something like "sudo gedit /etc/passwd"). Be very careful if you open this
file because you could make changes to your system that will lock you out!

Here's an example from /etc/shadow. Note that I have changed the numbers for
security reasons.

man:*:13991:0:99999:7:::

Again, as in the example above, "man" is the account. The "*" represents the
password for this account. The next number indicates the number of days
(since 01/01/1970) since the password was last changed. Following that is
the minimum number of days before a password can be changed ("0"), and then
the maximum ("99999"). Following that, "7" represents the number of days
that the account is given as warning that a password must be changed. You
could run into two additional fields (separated by the colons above), those
being the number of days after password expiration until the accoount
becomes disabled, and, in the case of a disabled account, the number os days
since 01/01/1970 that the account has been disabled.

If you look at an actual user account password in /etc/shadow, you will note
that the encrypted password may have something like four times the number of
digigts that are in the actual password.

-- 
Rob Smith

Sent from a PC Running Ubuntu Linux (Hardy)
An Open Source alternative to the Microsoft Tax
http://www.ubuntu.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ubuntu Linux" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ubuntulinux?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to