Link to home
Start Free TrialLog in
Avatar of jslayton01
jslayton01

asked on

Changing System Time

This concerns me a bit. Everytime I want to adjust the Date/Time it asks for my ROOT password. But the problem is, there is an IGNORE button.

Whats the point of having that there anyway if ROOT is the only one to change the time.

So, does this mean Im running as ROOT???? I HOPE NOT.... If not, then why does it have the IGNORE option in the password prompt???

Im running SUSE Linux...

Please explain this... I hope Im not running as ROOT.... I also checked when the output of this command 'id' Please Note: That my Username is 'vin001'
uid=1000(vin001) gid=100(users) groups=16(dialout),33(video),100(users)

Also I did this 'whoami'

vin001@linux:~> whoami
vin001
vin001@linux:~>

What BOTH command's output would say if I were to run as ROOT??? Please explain. I would appreciate it.

But one thing that bugs me if I'm running as my regular user (vin001), then why would it have the IGNORE option on the password prompt then???

Avatar of steveb3210
steveb3210

It just means the date program is running "temporarily" as root..

Its ok

Incidently, an easy way to set the date from the command line is

rdate -a time-a.nist.gov
So..the Long answer is...

When you run a program it runs under the permsissons of the user than runs the program unless one of two things are true

1.  The program is SetUID meaning someone has run chmod u+s on the program and it will run under the privileges of the owner of the program.  An example of this is the 'passwd' command.

2.  You specifically run the program under the id of someone else, e.g.

Run the following as your user:       su - root -c 'whoami'
You'll see it returns 'root'

This is because the whoami program was run under the privieges of root.

What SUSE is doing is saying is "what is your root password so we can can run the date command with root privileges?"  In order to change the date, you need root privileges - this is a requirement of the kernel.

So like i said in the first post, its ok!
Avatar of jslayton01

ASKER

Ok...now Im really confused here.

My biggest  concern here, is that am I running as ROOT or not?

If I am, thats a big problem. So, just to confirm, am I running as ROOT based on the posted outputs of my commands above?

Yes or No?
So one more thing. Even If I try changing the time under the IGNORE option, it will n ot changge the time?????

Correct me if I'm wrong...
If you run 'date' without root privileges you will not be able to change the time.

The exception to this is some windows managers have way of getting root privileges and hold onto the for a specfic period of time - for example in Fedora Core 2 while running Gnome, it'll show a key icon to say that it will run programs requriing root as root.

Hit ignore and it shouldn't change the time.
Oh, another usefull command to read about is 'sudo' which lets you define things to be run as root without requiring the root password.  Good if theres something you use alot , e.g. mount

so if your user bob and you configure bob to be able to use sudo for the mount command he could do something like

sudo mount /mnt/cdrom

and it wonj't ask him for the pw.
Ok so, just to confirm, if I hit IGNORE, and try to change the time, it will not take effect. Am I correct?

And also,  the outputs from the first post, am I ROOT or a regualr user?

Just please say I am OK as far as NOT running as ROOT...then I'm a happy camper...
Right, it should not take effect.

If your user was somehow root, the UID would be 0.

I'd rather have you understand why your ok rather than just make you feel ok! :)

Again, try this experiment

As your user run:

whoami

su - root -c 'whoami'


One will show your username the other will show you as root.  When you did it the second time your were telling the system to specifically run as root which is why it reports it as such.

Hope that helps.

Stephen





Ok, heres what I did:

vin001@linux:~> whoami
vin001
vin001@linux:~> su - root -c whoami
Password:


I have very very important data on this Linux box. I would please appreciate it if you can confirm that I am running as ROOT or not.

Now, the commands that you gave me here are the outputs above this post.. Please confirm that if Im running as ROOT or not.

And thanks again.
Please look again. This time I put ROOT's password and I hit enter and it shows ROOT.

vin001@linux:~> su - root -c whoami
Password:
root
vin001@linux:~> su - root -c whoami
Password:
root
vin001@linux:~>
I AM CONFIRMING THAT YOUR NOT RUNNING AS ROOT.

Thats the expected results, you enter the password, and it changes your UID to roots while it runs that command then switches back when its done.  

Take a look at "man su" to find out about the magic.

Take a look at that program /bin/su

[root@coffee root]# ls -lar /bin/su
-rwsr-xr-x    1 root     root        47522 Aug 12  2003 /bin/su

Whats intersting here is that the permissions show an 's' in the execute bit for the user privileges.  What it means is that that program runs with the privileges of root whenever its run.  If you look at the passwd command, you will see the same thing.

The 's' is what allows su to switch to the root user and run the command once its checked your password.  The 's' stands for setUID...

I'll keep working with you so you understand this - this is a really important thing to understand about Linux.

Stephen
 
I understand about the SU part. Meaning Switch User. I know. Its the same thing as thr RunAs in Windows. But, its weird to see an IGNORE option when it asks for ROOT password. Its silly rather.... I tested it by hitting ignore and I tried changing the date, I hit Accept and OK and it did not seem to take effect. I put the date as May 09 but its still stuck on todays date after I accepted it.

I know....I am very very security concious in both Windows and Linux. I posted the output for WHOAMI and ID. From that, can you tell if Im not running as ROOT??

Also, I heard that if theres like a '#' after the shell prompt, then you know your root.

So again, and I appologize for being this paranoid, So I AM NOT running as ROOT? Am I correct?

I have important data so I'd would be happy if I know that Im not running as root.

I am 95% that Im not.....because during install, I chose to create an additional user account other than root. But this is a question to CONFIRM that I am not running as root. Because I had been thinking about it since I saw that ignore option in the ROOT's Password window...

Andy



ASKER CERTIFIED SOLUTION
Avatar of steveb3210
steveb3210

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok thanks...now Im reassured.