You are not logged in.

#1 2007-10-06 15:28:19

eldarion
Member
From: Santarém - Portugal
Registered: 2006-08-01
Posts: 71

[SOLVED] Ask root password automatically [question]

Hi, everybody. 

Is there any way for console apps that need to be run as root to ask root password when we type the command?

Ex:

[user@localhost ~]$ pacman -Syu
You cannot perform this operation unless you are root. Please, insert the root password:

I know that there is "sudo", but i really dont like it because i have allways to type "sudo command".

Thanks in advance.

Last edited by eldarion (2007-10-06 18:46:50)

Offline

#2 2007-10-06 15:36:45

bwalk
Member
Registered: 2007-03-21
Posts: 177

Re: [SOLVED] Ask root password automatically [question]

Alias them to whatever you like.

alias pacman='su -c /usr/bin/pacman'
alias pacman='sudo /usr/bin/pacman'

Offline

#3 2007-10-06 15:37:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED] Ask root password automatically [question]

su -c "pacman -Syu"

I think your user has to be in a "wheel" group.

Offline

#4 2007-10-06 18:45:06

eldarion
Member
From: Santarém - Portugal
Registered: 2006-08-01
Posts: 71

Re: [SOLVED] Ask root password automatically [question]

Now that's better!

Ok, Thanks for replying.

Offline

Board footer

Powered by FluxBB