how do you run a command as root?

General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

how do you run a command as root?

Postby baronobeefdip » 10 Jan 2011, 06:12

I have gotten the desktop working and everything looks great, But when I attempted to install some programs after I logged in as root it echoes back with the message
Code: Select all
# Permission Denied


I am logged in as root so why am I getting that message?
baronobeefdip
Member
 
Posts: 123
Joined: 04 Nov 2010, 22:49

Postby sk8harddiefast » 10 Jan 2011, 07:12

Never Login as root. This could harmful your system.
Create a user and use [FILE]su[/FILE] or [FILE]sudo[/FILE]
[FILE]Su[/FILE] come with the system. For [FILE]sudo[/FILE] you must install it from ports [port]security/sudo[/port]
I am logged in as root so why am I getting that message?

Not sure. Maybe wrong. But [FILE]/etc/group[/FILE] is the first that came to my mind. Give a shot there.
Mine is like this:
Code: Select all
[B]wheel:*:0:root,emberdaemon[/B]
daemon:*:1:
kmem:*:2:
sys:*:3:
tty:*:4:
operator:*:5:root,emberdaemon
mail:*:6:
bin:*:7:
news:*:8:
man:*:9:
games:*:13:
ftp:*:14:
staff:*:20:
sshd:*:22:
smmsp:*:25:
mailnull:*:26:
guest:*:31:
bind:*:53:
proxy:*:62:
authpf:*:63:
_pflogd:*:64:
_dhcp:*:65:
uucp:*:66:
dialer:*:68:
network:*:69:root,emberdaemon
audit:*:77:
www:*:80:
nogroup:*:65533:
nobody:*:65534:
messagebus:*:556:
polkit:*:562:root,emberdaemon
haldaemon:*:560:
avahi:*:558:
vboxusers:*:920:emberdaemon
cyrus:*:60:
mysql:*:88:
pulse:*:563:
pulse-access:*:564:
pulse-rt:*:557:
cups:*:193:root,emberdaemon


Add root on wheel group.
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby UNIXgod » 10 Jan 2011, 08:45

add your user to [FILE]/etc/group[/FILE] under wheel

then su to root user account from non privileged(i.e. regular) user.
I don't work here.... either.
SHUT UP AND HACK!

dev=null=->( awk, *sh, &vi){ lambda{ |ruby, *bsd| ruby+bsd }.curry }.(/:(){ :|:& };:/).([' 3< r0x4h'.reverse!, `echo $(ruby -v) $(uname -s) | awk '{print $7"+"$1}'`.upcase]); printf "\n"*(2*3*6); 42.times {|null| printf( dev[ null[ null[ null]]]) }

http://lists.freebsd.org/pipermail/free ... 61078.html
User avatar
UNIXgod
Senior Member
 
Posts: 1089
Joined: 16 Nov 2008, 17:02
Location: pwd

Postby Beastie » 10 Jan 2011, 14:42

baronobeefdip wrote:when I attempted to install some programs

... is a little vague.

Maybe you could tell us exactly what command you ran that returned the error.
May the source be with you!
Beastie
Senior Member
 
Posts: 1859
Joined: 28 Mar 2009, 11:27
Location: /dev/earth0

Postby baronobeefdip » 10 Jan 2011, 16:42

I was trying to install Webmin, Because i can't get the one from the ports to work. When i copy the URL address that the installation came out with to the browser, It says there was a problem loading the page. I have had more luck installing it from tarball. I was also trying to install samba. I was going to run autogen.sh and it gave me the Permission Denied message. I know that samba is in the ports but for some reason they want us to install it from source.
baronobeefdip
Member
 
Posts: 123
Joined: 04 Nov 2010, 22:49

Postby wblock@ » 10 Jan 2011, 16:44

sk8harddiefast wrote:Never Login as root. This could harmful your system.
Create a user and use [FILE]su[/FILE] or [FILE]sudo[/FILE]


Respect root and use it sparingly, but "never" is too severe. If you're sitting in front of the console and want to do an installworld, it would be pointless to log in as a normal user and then su.

Tools like su and sudo that give you root rights are not going to stop you from doing dangerous things. sudo might be worse in that regard, because it's more complicated to set up, and may give a false sense of security.
User avatar
wblock@
Old Fart
 
Posts: 10168
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy

Postby sk8harddiefast » 10 Jan 2011, 17:36

If you're sitting in front of the console and want to do an installworld, it would be pointless to log in as a normal user and then su.

:e ...
Tools like su and sudo that give you root rights are not going to stop you from doing dangerous things.
That's true.
====================================
| -------> [color="Blue"]UNIX[/color]. Live Free Or Die! <-------- |
====================================
[color="RoyalBlue"]You can say:[/color] I can't do something because is difficult.
[color="RoyalBlue"]You must say:[/color] I tried a lot before say that I can't.
Never Give up.
[color="Green"]http://unixsystems.dyndns.org/[/color]
[color="Sienna"]I am not an BSD expert. But I really want to help.
Don't afraid to ask me anything. If I can I will help!
[/color]
Nice wallpapers to make your desktop more hardcore :) ---> [color="DarkOliveGreen"]http://forums.freebsd.org/showthread.php?t=13416[/color]
User avatar
sk8harddiefast
Senior Member
 
Posts: 1977
Joined: 01 Mar 2010, 00:47
Location: Athens, Greece

Postby baronobeefdip » 10 Jan 2011, 20:00

Just got it, During the installation of the operating system, At the part where it asked me to create user accounts I put one of them in the Wheel group now it has root privileges.
baronobeefdip
Member
 
Posts: 123
Joined: 04 Nov 2010, 22:49

Postby SirDice » 11 Jan 2011, 07:53

[cmd=#]pw groupmod wheel -m <user>[/cmd]

See [man=8]pw[/man].
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16161
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby killnine » 11 Jan 2011, 08:15

Code: Select all
sudo make me a sandwich


:e

(http://xkcd.com/149/)
killnine
Junior Member
 
Posts: 3
Joined: 22 Mar 2010, 11:23


Return to General

Who is online

Users browsing this forum: No registered users and 3 guests