You are not logged in.

#1 2005-10-14 21:19:45

pjezek
Member
From: Praha - CZ
Registered: 2005-05-19
Posts: 79

Sudo or su and root's password

A root's login prompt are simply without password prompt, I never typed root's password when I logged in as root. How to find the root's password, change it and use it with 'su' command? Visudo (Vi) has a very strange syntax for editing, I cannot edit sudoers file despite of reading man vi. Is there neccessary edit sudoers file with visudo to give the user some root's privilegues? Thanks a lot, I am quite an old dog to learn all quickly and wish to use Arch regulary...


Our tomcat for your mice! Archlinux for your comps! Alfa Romeo for your roads! Faster running guaranted!

Offline

#2 2005-10-14 21:36:25

Deciare
Member
From: UTC -8:00
Registered: 2005-05-05
Posts: 79

Re: Sudo or su and root's password

Log in as root (doing it without a password is fine), then use the passwd command to set a new password.

You don't need to do anything with sudo if a root password is all you want, but if you want to give another account (like your normal user account) full control over everything, then add this line with visudo:

yourusername ALL=ALL

That's the most basic configuration that allows "yourusername" to run all commands as root. It also means that your system security is only as good as "yourusername"'s password (since that's the password sudo asks for).

You mentioned that you were wondering whether it was necessary to give a user "some" root privileges with sudo. What kinds of privileges did you have in mind?

Offline

#3 2005-10-14 21:41:01

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Sudo or su and root's password

It sounds like you never set root's password. To set it, enter (as root)

passwd

.

About visudo and vim, to enter text type "i" this means "insert text". Hitting the ESC key puts you into command mode, were you can no longer edit the file. From here (command mode) you can save and exit by typing ":wq" and enter. The "w" stands for write and "q" stands for quit. So to exit without saving it would just be ":w". Alternately to the save and exit command listed above you should be able to do "<shift->zz".

Offline

#4 2005-10-14 22:35:59

cs25x
Member
Registered: 2004-05-04
Posts: 150

Re: Sudo or su and root's password

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

username ALL=NOPASSWD:   /usr/bin/cdrecord,/usr/bin/gcombust,/usr/bin/cdrdao,/usr/bin/eject,/bin/mount,/bin/umount,/usr/X11R6/bin/XFree86,/opt/kde/bin/k3b,/usr/sbin/fping,/usr/bin/kismet


# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

gives the user "username" rights to run cdrecord, gcombust,cdrdao ... etc
This is saves a lot of work when you regrade those apps which need root privledges to run.

#!/bin/sh

DEV="/dev/burner"

if [ ! $2 == "" ]; then SPEED=$2 ; else SPEED=52 ; fi
time sudo cdrecord -tao dev=$DEV speed=$SPEED driveropts=burnfree -overburn -eject $1

is my script for burning as an ordinary user. I just call it burn. as in

burn /tmp/arrgh.iso

--(*(cs25x--));

Offline

#5 2005-10-15 03:15:53

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Sudo or su and root's password

maybe i'm weird but i've never had any problems burning cds as a non-root user.

Offline

#6 2005-10-15 16:41:46

jftaylor21
Member
From: Arch Linux Forums
Registered: 2004-02-21
Posts: 237

Re: Sudo or su and root's password

Penguin wrote:

From here (command mode) you can save and exit by typing ":wq" and enter. The "w" stands for write and "q" stands for quit. So to exit without saving it would just be ":w". .

Shouldn't it be ":q" to exit without saving? tongue

Offline

#7 2005-10-15 17:00:57

arooaroo
Member
From: London, UK
Registered: 2005-01-13
Posts: 1,268
Website

Re: Sudo or su and root's password

jftaylor21 wrote:
Penguin wrote:

From here (command mode) you can save and exit by typing ":wq" and enter. The "w" stands for write and "q" stands for quit. So to exit without saving it would just be ":w". .

Shouldn't it be ":q" to exit without saving? tongue

If you've made a change I think you need to do :q!

Offline

#8 2005-10-15 21:20:37

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Sudo or su and root's password

jftaylor21 wrote:
Penguin wrote:

From here (command mode) you can save and exit by typing ":wq" and enter. The "w" stands for write and "q" stands for quit. So to exit without saving it would just be ":w". .

Shouldn't it be ":q" to exit without saving? tongue

yeah, sorry. And you do need the ! to quit without saving if you made changes.

Offline

#9 2005-10-17 17:45:45

pjezek
Member
From: Praha - CZ
Registered: 2005-05-19
Posts: 79

Re: Sudo or su and root's password

Thanks a lot, Penguin, you were right, the root password had not been set! I was courious about "su" command invoking password prompt and followed by failed login when leaving password blank...

I had to be blind to miss "i" and "w" commands for editing visudo... Too many work on too many orchards set me completely dull... Hooray! An old dog is using and configuring hardcore linux distro! With your kind help, thank you again!


Our tomcat for your mice! Archlinux for your comps! Alfa Romeo for your roads! Faster running guaranted!

Offline

Board footer

Powered by FluxBB