I Need Help In Linux


Cervante

PS3 ID: Cervante1
Joined
Jun 28, 2006
Messages
573
Location
SD card slot
Website
Visit site
Hey everyone, I got a final on linux next week. Studying my brains out, anyhow im having a hard time with something. Can someone tell me how to create a second administrator (root) called sysadmin? :unsure:

I have to do it in runlevel 3 (Text Mode/Terminal)

Im using SuSE 9 Distro
 
Cervante said:
Hey everyone, I got a final on linux next week. Studying my brains out, anyhow im having a hard time with something. Can someone tell me how to create a second administrator (root) called sysadmin? :unsure:

I have to do it in runlevel 3 (Text Mode/Terminal)

Im using SuSE 9 Distro
man adduser
 
Last edited by a moderator:
I can't help you with that because I don't know. I don't know because it is such a spectacularly bad idea that I never bothered to learn. It's very Windows-ish. A quick google revealed this:
"The way to add a superuser is to create another user account with a userid 0."

But I still think it's a bad idea.

A better option would be to create a regular user named "sysadmin" and give him full access to everything through sudo. You can disable root at this point if you want. (This is Ubuntu's default setup). This is a better idea because sudo will let you keep track of what everyone does with it, and as long as you don't have the nopassword option set, the user should have to use their sudo password whenever they want to do something beyond their access. Sudo is also a nicer solution because you can give users superuser access to certain things based on their need without giving them full run of the machine. It is a security risk (exploits in sudo could be used to escalate their privileges), but it's less of one than putting everyone in wheel or having multiple superuser accounts. Alternately, you could add "sysadmin" to the wheel group and give him the root password, but I'm assuming you're doing this so that an intruder would need to guess both the username and the password of the superuser, rather than just the password, so you'd probably be disabling root anyway.

But none of that helps you with your test, so this was kind of a waste of your time to read, I guess. File it away for future reference, I guess.

FreeBSD (and the other BSDs, too, I think) also include an account "toor" which is disabled by default, but it's not really included as an "additional" superuser account. It's intended as a way to use shells that aren't included in the base system (such as bash, which isn't included in a default FreeBSD install) without fucking with root's settings. This is important because in the case of a catastrophe, you may only have / to work with and if your shell isn't in /bin, you're fucked.
 
moz said:
hehehe i didnt know that linux doesnt use a wheel group like in BSD

http://eric.extremeboredom.net/2004/04/30/179


I'd heard of that before but I thought the Linux people had moved past that to a more sensible policy. I didn't know it was still the case.

Edit: Looks like some of them have.
QUOTE

Fortunetly, I found theres a PAM module written by one of the friendly RedHat folks that adds wheel checking support.

Add the following lines to /etc/pam.d/su:


auth required /lib/security/pam_wheel.so use_uid

The readme for the pam_wheel module is avaliable here.

And if you’re REALLY parinoid, check out the new SELinux features in Kernel 2.6 which allows you to get rid of the whole concept of a superuser alltogether.
 
Last edited by a moderator:
I remember using 'sudo' on a system, getting fedup of having to type my password in on almost every command I was typing, and ended up typing 'sudo su'. I got a not-so-friendly email a few hours afterwards :D (I replied saying that if you don't want me using that command, why allow it? but got no further replies)

To way I changed the name of the root account was to edit /etc/passwd directly with a text editor. I suppose thats not the correct/official way tho' and could screwup some authentication tokens, depending on what your running. I suppose the best would be to just add another user and change the gid/uid of that user.
 
Squidge said:
I remember using 'sudo' on a system, getting fedup of having to type my password in on almost every command I was typing, and ended up typing 'sudo su'. I got a not-so-friendly email a few hours afterwards :D (I replied saying that if you don't want me using that command, why allow it? but got no further replies)

To way I changed the name of the root account was to edit /etc/passwd directly with a text editor. I suppose thats not the correct/official way tho' and could screwup some authentication tokens, depending on what your running. I suppose the best would be to just add another user and change the gid/uid of that user.
Found some rules here that would get around that, but you could get around them by cp-ing su somewhere else on the system. You could also deny access to cp, but that's getting into a pain in the ass game of cat and mouse. The whole point of sudo is to give root access to only what the user needs. Sudo as a replacement for full root privileges is a better idea than separate admin accounts because of sudo's logging abilities, but shouldn't be given to untrusted users in any case (such as, say, someone who does sudo su ;) ) I also could have swore that you could set the user's sudo password separate from the user's password, but it appears I'm incorrect because I can't seem to find any info on it. Basically, don't give unfettered sudo access to anyone you wouldn't give the root password to. In your case, if constantly having to type in your password is a pain, a NOPASSWD could have been added to the commands you needed to run and what you didn't need could have been restricted. Or you could have been given a chroot jail to do whatever you needed in, if you needed full access to the system. Basically, it sounds like your sysadmin was lazy and he got angry at you for making him work, but I don't know the whole situation so I may be oversimplifying it.

This appears to be a decent article on sudo for the OP. Also, the sudoers manual says you can set it to insult people when they get their password wrong. That's a pretty awesome feature, if you ask me.
 
Last edited by a moderator:
:D I got it, ty all..heres what I did..

create a second administrator (root) called sysadmin
Upon boot the text-mode appears
YourLastName:~#
YourLastName:~# useradd -o -u 0 sysadmin"Enter"
YourLastName:~#
YourLastName:~# tail -n 1 /etc/passwd "Enter"
sysadmin:x:0:100: :/home/sysadmin:/bin/bash
YourLastName:~#
YourLastName:~# passwd sysadmin"Enter"
Changing password for sysadmin
New Password:
Changing password for sysadmin
New Password: password "Enter"
Bad Password: it is based on a dictionary word
Reenter New Password:
Bad Password: it is based on a dictionary word
Reenter New Password: password "Enter
Password Changed
YourLastName:~ #
YourLastName:~ #"Alt+F3"

Switched to another console, login as sysadmin not root.
YourLastName:~#
YourLastName:~# useradd (randomname) "Enter"
YourLastName:~#
YourLastName:~# logout "Enter"

Login as root again
 
Back
Top