[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Changing System Time

Posted on 2005-05-05
14
Medium Priority
?
237 Views
Last Modified: 2010-04-20
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???

0
Comment
Question by:jslayton01
  • 7
  • 7
14 Comments
 
LVL 1

Expert Comment

by:steveb3210
ID: 13941656
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
0
 
LVL 1

Expert Comment

by:steveb3210
ID: 13941700
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!
0
 

Author Comment

by:jslayton01
ID: 13946617
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?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:jslayton01
ID: 13946637
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...
0
 
LVL 1

Expert Comment

by:steveb3210
ID: 13946848
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.
0
 
LVL 1

Expert Comment

by:steveb3210
ID: 13946867
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.
0
 

Author Comment

by:jslayton01
ID: 13947031
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...
0
 
LVL 1

Expert Comment

by:steveb3210
ID: 13948686
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





0
 

Author Comment

by:jslayton01
ID: 13949160
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.
0
 

Author Comment

by:jslayton01
ID: 13949176
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:~>
0
 
LVL 1

Expert Comment

by:steveb3210
ID: 13949225
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
 
0
 

Author Comment

by:jslayton01
ID: 13949316
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



0
 
LVL 1

Accepted Solution

by:
steveb3210 earned 500 total points
ID: 13950840
When you posted the whois information initally, you can see.

uid=1000(vin001) gid=100(users) groups=16(dialout),33(video),100(users)

the UID would be 0 if you were running as root.

I agree that "ignore" is a poor choice of words - Linux isn't known for its GUI friendliness...


Stephen
0
 

Author Comment

by:jslayton01
ID: 13951140
Ok thanks...now Im reassured.

0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question