Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Where Penguins and Daemons chill together in the warmth of the Sun.

Moderators: SecretSquirrel, notfred

Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 10:24 pm

To start here's what I'm working with:

- AMD Athlon 64 X2 4800+ Brisbane 2.5GHz (65nm)
- ABIT AN-M2HD AM2 NVIDIA GeForce 7050PV
- G.SKILL 4GB (4 x 1GB) 240-Pin DDR2 SDRAM DDR2 800 (PC2 6400)
- Western Digital Caviar SE16 WD2500KSRTL 250GB (80GB partition set aside for linux, 64-bit Vista Home Premium on the 160GB partition)
- GeForce 8400 GS

I'm running 32-bit Fedora 8 (someone lent me the disc after several copies of the 64-bit installation DVD ISO I burned didn't work properly and I was too lazy to download it and burn it again...) and one thing I've noticed is that lately Fedora always seems to be utilizing almost exactly half of the CPU resources. Fedora sees the dual core CPU as two processors and the sum of the percentage used for each core always adds up to roughly 100%. In other words, one core will be at ~40% and the other will be at ~60%, or ~70% and ~30%, etc. The CPU fan can run at variable speeds, but its always running at full speed in Fedora. For the most part the system is still very responsive, however when doing some simple things, such as clicking on the desktop and dragging the cursor around, the system suddenly starts to slow down for no apparent reason. It appears that either there is something running somewhere hogging half of my CPU resources, or else something is misconfigured. In either case, I have no idea how to track down the problem. There isn't much installed on this partition that wasn't an update except the latest nVidia linux drivers.

My second question is a fairly straightforward one, whenever I use sudo in a terminal window within the GUI and then enter the root password, I get an incorrect password message. However, if I exit X or go to a full screen terminal, with Ctrl + Alt + F1 for example, I have no problems entering the same password and running the command.

On a side note, for a while, I had no problem hitting Ctrl + Alt + F1 to switch to a terminal and then Ctrl + Alt + F7 to go back to the GUI, but lately, when I hit Ctrl + Alt + F7, I get nothing but a black screen and the cursor. I have no idea whats going on here, but any help you guys can give me is much appreciated, as always.
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:01 pm

zer0 wrote:My second question is a fairly straightforward one, whenever I use sudo in a terminal window within the GUI and then enter the root password, I get an incorrect password message.
When using sudo you typically enter your own account's password, not the root password (you can set it up the other way, but by default you enter your password).

zer0 wrote:On a side note, for a while, I had no problem hitting Ctrl + Alt + F1 to switch to a terminal and then Ctrl + Alt + F7 to go back to the GUI, but lately, when I hit Ctrl + Alt + F7, I get nothing but a black screen and the cursor.
Have you tried other VTs like Ctrl-Alt-F6 and Ctrl-Alt-F8-F10. F7 is traditional, but some configurations will cause to spawn X on different screens/VTs.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:19 pm

Have you tried running the top command to see what process(es) are hogging the CPU?

By default, sudo does not require the root password, it requires the password of the user who is invoking sudo. The rationale here is that the user is already trusted (i.e. in order to use sudo they must have been explicitly added to the /etc/sudoers file by someone with root privileges), so all the system really needs to do is verify that the user is really who they seem to be. This guards against someone with sudo privileges leaving their workstation unattended, and someone else sitting down at their keyboard and doing something evil to the system.

Dunno what's up with your Ctrl-Alt-F1/Ctrl-Alt-F7 problem.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37705
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:29 pm

bitvector wrote:When using sudo you typically enter your own account's password, not the root password (you can set it up the other way, but by default you enter your password).


within the GUI it doesn't work, but if I exit X and use it, I can use the root password. is that normal?

bitvector wrote:Have you tried other VTs like Ctrl-Alt-F6 and Ctrl-Alt-F8-F10. F7 is traditional, but some configurations will cause to spawn X on different screens/VTs.


Ctrl+Alt+F1 through F6 bring up a shell, F7 brings up the GUI, and F8 and above bring up a black screen that looks like it could be a shell, but there is no login prompt, only a blinking underscore character. This only started happening recently. also, if I go back to F6, the cursor changes as if its passing over text, etc, but I can't do anything. The interesting thing is, if I hit Ctrl+Alt+Backspace, I get the GUI login prompt and I can log back in, but all of my windows have been closed...
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:32 pm

zer0 wrote:
bitvector wrote:When using sudo you typically enter your own account's password, not the root password (you can set it up the other way, but by default you enter your password).

within the GUI it doesn't work, but if I exit X and use it, I can use the root password. is that normal?
When you exit X and go to a virtual terminal you are logging in as the root user, whereas sudo is completely different -- you aren't logging in, you are temporarily assuming root's identity. As both JBI and I have said earlier, you type in your own password when using sudo, not root's password.
Edit: Or do you mean sudo actually works differently when you invoke it from a virtual terminal?

zer0 wrote:The interesting thing is, if I hit Ctrl+Alt+Backspace, I get the GUI login prompt and I can log back in, but all of my windows have been closed...
Oh, okay... well then X is running on that VT so it wasn't what I was thinking.
Last edited by bitvector on Wed Jan 30, 2008 11:41 pm, edited 1 time in total.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:39 pm

zer0 wrote:For the most part the system is still very responsive, however when doing some simple things, such as clicking on the desktop and dragging the cursor around, the system suddenly starts to slow down for no apparent reason.
BTW, you say it slows down when clicking on the desktop and dragging. Do you by chance have 3D desktop effects enabled (they may be enabled by default in Fedora)?
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:44 pm

just brew it! wrote:Have you tried running the top command to see what process(es) are hogging the CPU?


looks like something called 'pcscd,' though I'm not exactly sure what I'm looking at. most of this stuff is completely new to me.

just brew it! wrote:The rationale here is that the user is already trusted (i.e. in order to use sudo they must have been explicitly added to the /etc/sudoers file by someone with root privileges)


how do I do that?
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Wed Jan 30, 2008 11:49 pm

bitvector wrote:Do you by chance have 3D desktop effects enabled (they may be enabled by default in Fedora)?


Actually I do, but I don't think thats it. Moving windows around and dragging between screens seems to have no effect, its still perfectly smooth despite dragging my wobbly windows all around the cube (which by the way is the greatest time waster ever for someone whose never seen that before). But doing something as simple as clicking on an empty part of the desktop and dragging the mouse around as if I wanted to select several desktop icons or something like that cause the motion to get very jerky. This isn't a major concern of mine in itself, I'm just thinking its related to the high CPU usage.
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:05 am

zer0 wrote:
just brew it! wrote:The rationale here is that the user is already trusted (i.e. in order to use sudo they must have been explicitly added to the /etc/sudoers file by someone with root privileges)

how do I do that?
If you need to add users to sudoers, just edit your /etc/sudoers file (the visudo command is provided for that purpose) and add a line like this:
Code: Select all
username   ALL=(root) ALL
That will allow the user account "username" to run sudo and become root by typing in his own password.

You could also do something like:
Code: Select all
%groupname ALL=(root) ALL
which would allow all users belonging to the group "groupname" to become root. The group "wheel" is often used for that purpose.

If, in the above examples, you substitute (ALL) for (root), that allows someone to sudo to any other user (although you can do that anyway with su if you can already sudo to root, since root is all powerful). You can also set it up to not prompt for a password and other fancy stuff.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:16 am

bitvector wrote:When you exit X and go to a virtual terminal you are logging in as the root user, whereas sudo is completely different -- you aren't logging in, you are temporarily assuming root's identity. As both JBI and I have said earlier, you type in your own password when using sudo, not root's password.
Edit: Or do you mean sudo actually works differently when you invoke it from a virtual terminal?


I seem to remember being able to use sudo while logged in my normal account (not root) when in a virtual terminal, but not in the GUI, but I haven't played around with the Fedora partition on this machine for a while until recently when I installed some updates. Thats not the case anymore though. Now I can no longer enter the root password when using sudo regardless of whether I'm in a VT or the GUI. Although according to you guys, thats how it should be, so its fine with me.

bitvector wrote:If, in the above examples, you substitute (ALL) for (root), that allows someone to sudo to any other user (although you can do that anyway with su if you can already sudo to root, since root is all powerful).


/me watches and whistles as that statement sails right over my head...

bitvector wrote:If you need to add users to sudoers, just edit your /etc/sudoers file and add a line like this:

Code: Select all
username   ALL=(root) ALL

That will allow the user account "username" to run sudo and become root by typing in his own password.


So can I stick that line anywhere then?
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:21 am

zer0 wrote:Now I can no longer enter the root password when using sudo regardless of whether I'm in a VT or the GUI. Although according to you guys, thats how it should be, so its fine with me.
Perhaps you were using "su" instead of "sudo" before?

zer0 wrote:So can I stick that line anywhere then?
You need to put it in the COMMANDS section at/near the end of the file. Your existing /etc/sudoers should have stuff in there commented out (lines starting with # are ignored) that looks a lot like the example statements I posted. For example, here is an excerpt from the default Fedora 8 sudoers file:
Code: Select all
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
# %wheel        ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now

You could put it right after the root ALL=... line or at the end.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:30 am

bitvector wrote:You need to put it in the COMMANDS section at/near the end of the file.


Ok thanks, I'll give it a try.
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:32 am

zer0 wrote:looks like something called 'pcscd,' though I'm not exactly sure what I'm looking at. most of this stuff is completely new to me.

The top command displays the processes which are using the most CPU, sorted from highest to lowest. What is the %CPU column showing for the pcscd process? The pcscd process is part of the smart card reader subsystem; if it is soaking up tons of CPU, then something is confused.

Also, what are your load average numbers (upper right corner) if you just let the system sit idle for a couple of minutes?

just brew it! wrote:The rationale here is that the user is already trusted (i.e. in order to use sudo they must have been explicitly added to the /etc/sudoers file by someone with root privileges)

how do I do that?

Well, if you were able to use sudo before, your user name is already in there. If this is the user account which was created during system installation, the installer probably put it there for you.

Moving windows around and dragging between screens seems to have no effect, its still perfectly smooth despite dragging my wobbly windows all around the cube (which by the way is the greatest time waster ever for someone whose never seen that before). But doing something as simple as clicking on an empty part of the desktop and dragging the mouse around as if I wanted to select several desktop icons or something like that cause the motion to get very jerky. This isn't a major concern of mine in itself, I'm just thinking its related to the high CPU usage.

It could also be that you're not running hardware accelerated video drivers. What kind of video card do you have? I also suggest you go to System -> Administration -> Display -> Hardware and click the Configure button next to the video card, to see what driver is installed.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37705
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:37 am

zer0 wrote:Ctrl+Alt+F1 through F6 bring up a shell, F7 brings up the GUI, and F8 and above bring up a black screen that looks like it could be a shell, but there is no login prompt, only a blinking underscore character. This only started happening recently. also, if I go back to F6, the cursor changes as if its passing over text, etc, but I can't do anything. The interesting thing is, if I hit Ctrl+Alt+Backspace, I get the GUI login prompt and I can log back in, but all of my windows have been closed...
BTW, when this happens to you again, try hitting Ctrl-Alt-+ or Ctrl-Alt-- (plus and minus sign -- they need to the ones on the numeric keypad specifically, though). Those key sequences tell the X server to make the screen resolution higher or lower. Since Ctrl-Alt-Backspace works to kill X, it means you are talking to X, you just don't have video. If this is some weirdness with video mode switching not properly restoring your display when going back and forth from virtual terminals and X, explicitly changing the screen resolution with those key sequences might "jog" it back to displaying something. Maybe not, but worth a try.
bitvector
Grand Gerbil Poohbah
 
Posts: 3234
Joined: Wed Jun 22, 2005 4:39 pm
Location: Mountain View, CA

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 12:57 am

Once you've got all this figured out, you can edit /etc/inittab and make some application run on VT8-12, for instance, something that checks /var/log/messages and outputs them to VT12, for instance. The program that's running on VT1-6 is called getty, and it lets you log in.
EDIT: I'm really digging this new phpBB 3. It's even loading faster!
Mothership: Thuban 1055T@3.7GHz, 12GB DDR3, M5A99X EVO, GTX470+Icy Vision Rev.2@840/3800, Vertex 2E 60GB
Supply ship: Sargas@2.8GHz, 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Macbook Air Ivy Bridge
Crayon Shin Chan
Minister of Gerbil Affairs
 
Posts: 2241
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 9:15 am

sudo needs the user password (and to be authorised in /etc/sudoers), su needs the root password.

If you run top then you can press "1" (the number one and not the letter L) and it will switch between showing all the cpus together or showing each cpu individually in terms of usage.

I'm not sure why you would even be running pcscd on your system, I don't think you would need it.
notfred
Grand Gerbil Poohbah
 
Posts: 3736
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Thu Jan 31, 2008 8:48 pm

notfred wrote:I'm not sure why you would even be running pcscd on your system, I don't think you would need it.


I don't even know what it is...
I think the vast majority of people who tell you they have a virus actually mean 'I keep my pictures in the system32 folder and occasionally delete things at random'.

"it boots up so fast the desktop icons fly right off the screen..."
zer0
Gerbil
 
Posts: 89
Joined: Mon Oct 22, 2007 9:12 am
Location: New York

Re: Sudo in Terminal and Dual Core CPU Usage in Fedora 8

Postposted on Fri Feb 01, 2008 2:24 am

zer0 wrote:
notfred wrote:I'm not sure why you would even be running pcscd on your system, I don't think you would need it.

I don't even know what it is...

If you don't have a Smart Card reader on your system (or know what one is), you shouldn't be running pcscd. Go into your Services list (System -> Administration -> Services), highlight pcscd, and click the Stop button. Also uncheck it so that it will not start the next time you reboot.
(this space intentionally left blank)
just brew it!
Administrator
Gold subscriber
 
 
Posts: 37705
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer


Return to Linux, Unix, and Assorted Madness

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests

cron