LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   help. made a mistake editing /etc/group (https://www.linuxquestions.org/questions/slackware-14/help-made-a-mistake-editing-etc-group-629854/)

http:// 03-22-2008 09:26 AM

help. made a mistake editing /etc/group
 
hello,

i made a stupid mistake while editing /etc/group. i deleted the 'console' entry...

what does it look like by default? so i can just type it back again. how will this affect my computer.

anyway,

thanks

mike

willysr 03-22-2008 09:29 AM

on my system:
Code:

console::101:

hitest 03-22-2008 09:30 AM

Quote:

Originally Posted by http:// (Post 3096893)
hello,

i made a stupid mistake while editing /etc/group. i deleted the 'console' entry...

what does it look like by default? so i can just type it back again. how will this affect my computer.

anyway,

thanks

mike

Code:

console::101:
This is what it looks like.

http:// 03-22-2008 10:02 AM

thank you very much. :)

i apologize for bothering you with my carelessness

hitest 03-22-2008 10:37 AM

Quote:

Originally Posted by http:// (Post 3096925)
thank you very much. :)

i apologize for bothering you with my carelessness

No problem, you're welcome:-)

H_TeXMeX_H 03-22-2008 10:53 AM

I always make a backup of any file I edit outside my home directory especially in '/etc'. For example if I were to edit '/etc/group', before editing it I would make a copy called '/etc/group.$USER-backup' or something like that. That way if I completely mess it up, I can just copy it back and start over.

duryodhan 03-22-2008 11:50 AM

wouldn't vim have created a backup anyways? /etc/group~

H_TeXMeX_H 03-22-2008 01:22 PM

Yes, but I hate vim.

http:// 03-22-2008 05:47 PM

thanks for the tips.

I'm still using nano and I'm not sure if it automatically creates backups. Anyway, I'm backing files up manually before I edit them from now on. :)

Thanks for helping this linux/slackware newbie. :D

hitest 03-22-2008 05:57 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3097105)
Yes, but I hate vim.

Agreed. I usually use nano or kedit to modify stuff.

duryodhan 03-22-2008 11:44 PM

even kedit makes a backup :P

And how do you use kedit as root ? (I did xhost+ once, but thats said to be a security hole)

saulgoode 03-22-2008 11:56 PM

Quote:

Originally Posted by duryodhan (Post 3097469)
And how do you use kedit as root ?

$ su -s -c kedit

H_TeXMeX_H 03-23-2008 04:43 AM

nano and nedit, those are the only ones I use. vim is just ridiculous, I can't believe anyone likes it, but whatever.

duryodhan 03-23-2008 06:36 AM

Quote:

bash-3.1$ su -s -c kedit
Password:
No protocol specified
kedit: cannot connect to X server :0
:(

And forgive me for threadhijacking!

rg3 03-23-2008 07:08 AM

I usually run "xhost local:" (note the colon at the end) to enable any local user to use the X server. I'm not sure that's good from a security point of view, but it's definitely better than using "xhost +". After doing that, root should be able to use the X server too provided DISPLAY is set to ":0", for example.

brianL 03-23-2008 07:56 AM

I would have done:

Code:

kdesu kedit /etc/group
then you get a pop-up box asking for root's password. I usually use kwrite, but it should be the same for kedit.

hitest 03-23-2008 09:42 AM

I usually use nano in a root shell prompt to edit files.
Sometimes I don't like to work as root and I'll make a copy of a file I want to modify and then I'll make changes to the copy as a regular user. When I'm finished editing then I'll su to root and copy the file into the proper place.
Let us say you wanted to make changes to inittab. You could make a copy of that and place it in a directory (documents). As a regular user navigate to your directory and use kedit or kwrite to make changes to the copy then save. Then open up a shell prompt, su to root.

# cd /home/hitest/documents
# cp inittab /etc

I also like to back-up files before I change them.


All times are GMT -5. The time now is 09:21 PM.