LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2011, 07:21 AM   #1
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Rep: Reputation: 15
Changing root password


Hello to all,

I would like to change root password on my linux system.
I know that usual command is "passwd".
However, if I type passwd I'm offered to change password for the user Micik. When I installed my open suse I have defined user Micik (me) with root priviledge. When I inspect passwd file, I can see that there are both root and Micik users, and also when I type su root I can log in as root user.
Now, I would like to distinguish root from Micik (to have separate) passwords.
How can I do that?

Thanks
 
Old 10-15-2011, 08:25 AM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,742
Blog Entries: 27

Rep: Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065
Hi,

Look at 'passwd'!

Quote:
excerpt from 'man passwd';
NAME
passwd - change user password

SYNOPSIS
passwd [options] [LOGIN]

DESCRIPTION
The passwd command changes passwords for user accounts. A normal user may only change the
password for his/her own account, while the superuser may change the password for any account.
passwd also changes the account or associated password validity period.

Password Changes
The user is first prompted for his/her old password, if one is present. This password is then
encrypted and compared against the stored password. The user has only one chance to enter the
correct password. The superuser is permitted to bypass this step so that forgotten passwords may
be changed.

After the password has been entered, password aging information is checked to see if the user is
permitted to change the password at this time. If not, passwd refuses to change the password and
exits.

The user is then prompted twice for a replacement password. The second entry is compared against
the first and both are required to match in order for the password to be changed.

Then, the password is tested for complexity. As a general guideline, passwords should consist of
6 to 8 characters including one or more characters from each of the following sets:

ˇ lower case alphabetics

ˇ digits 0 thru 9

ˇ punctuation marks

Care must be taken not to include the system default erase or kill characters. passwd will
reject any password which is not suitably complex.
Just a few links to aid you to gaining some understanding;



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide
10 Linux Home Networking
11 Virtualization- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
 
Old 10-15-2011, 08:29 AM   #3
etech3
Senior Member
 
Registered: Jul 2009
Location: Virginia
Distribution: Debian Stable Testing Sid Slackware CentOS
Posts: 1,055
Blog Entries: 2

Rep: Reputation: 45
Code:
passwd root
Of course you need the power! (sudo)
 
Old 10-15-2011, 08:47 AM   #4
Micik
Member
 
Registered: Dec 2004
Distribution: open suse
Posts: 137

Original Poster
Rep: Reputation: 15
Thank you for replies. Of course I have read the man and I tried passwd root, but that didn't help me much because I manage to change password for root, but somehow I have lost super user right to user Micik.
When installing suse I entered only one user (Micik) which was usper user.
Later I have noticed that there is root user in passwd file and I tried login as root (su root) with password supplied to user Micik and it worked. This meant that one password is the same for both root and Micik.

I wanted to separate passwords for these users so I can have two users with admin priviledges.

Or maybe Micik was just alias for root???
 
Old 10-15-2011, 09:05 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,742
Blog Entries: 27

Rep: Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065Reputation: 2065
Hi,

You can use 'passwd' to change the passwords. You should have unique passwords for your users, be it root or normal users. All users, including root should have secure individual passwords. You might consider using 'su -' for your users;
Quote:
excerpt from 'man su';

su - change user ID or become superuser

SYNOPSIS
su [options] [username]

DESCRIPTION
The su command is used to become another user during a login session. Invoked without a username,
su defaults to becoming the superuser. The optional argument - may be used to provide an
environment similar to what the user would expect had the user logged in directly.

Additional arguments may be provided after the username, in which case they are supplied to the
user´s login shell. In particular, an argument of -c will cause the next argument to be treated
as a command by most command interpreters. The command will be executed by the shell specified in
/etc/passwd for the target user.

You can use the -- argument to separate su options from the arguments supplied to the shell.

The user will be prompted for a password, if appropriate. Invalid passwords will produce an error
message. All attempts, both valid and invalid, are logged to detect abuse of the system.

The current environment is passed to the new shell. The value of $PATH is reset to /bin:/usr/bin
for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the superuser. This may be changed with
the ENV_PATH and ENV_SUPATH definitions in /etc/login.defs.

A subsystem login is indicated by the presence of a "*" as the first character of the login
shell. The given home directory will be used as the root of a new file system which the user is
actually logged into.

OPTIONS
The options which apply to the su command are:

-c, --command COMMAND
Specify a command that will be invoked by the shell using its -c.

-, -l, --login
Provide an environment similar to what the user would expect had the user logged in directly.

When - is used, it must be specified as the last su option. The other forms (-l and --login)
do not have this restriction.
Not really a good thing to equate users as root. One system one 'root'! Keep it secure and clean. You will have less confusion and potential problems removed.

Look at 'GNU Linux Security - SecurityProNews - Internet Security News' for other useful hints.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
changing root password sunlinux Linux - Security 2 03-21-2006 06:24 AM
Root Password Keeps Changing jameskilbane Linux - Security 4 10-14-2005 04:51 PM
changing root password Bombo Linux - Newbie 2 04-10-2005 10:42 PM
changing root password minm Linux - Newbie 9 08-31-2004 03:03 AM
Changing root password Gibby Mandriva 1 10-02-2003 10:38 PM


All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration