PDA

View Full Version : Hopefully this can be fixed.


Superman3332001
08-10-2005, 07:12 AM
HI everyone.

I may have made a major mistake I aciddently edited the sudodoer file and I saw that it made a back up copy. How can i restore it back to normal.

Thanks

sybil
08-10-2005, 09:48 AM
No idea what that file is. Was the backup copy made before or after you edited? And do you remember what your edit was? If so, back up what you have and make the change back.

Ken_ver_1_5
08-10-2005, 10:08 AM
it is possible (I have done this) to delete the file and rename the backup file.
but before you do make a folder copy the two files to that folder.
and go back and do what I suggested.

Superman3332001
08-10-2005, 01:07 PM
it is possible (I have done this) to delete the file and rename the backup file.
but before you do make a folder copy the two files to that folder.
and go back and do what I suggested.
well this is the error I get. when I type
sudo gedit /etc/sudoers

>>> sudoers file: syntax error, line 19 <<<
sudo: parse error in /etc/sudoers near line 19

Am I mistaken that there is something wrong with my sudoers file.. Please let me know. Thanks

Superman3332001
08-10-2005, 01:07 PM
it is possible (I have done this) to delete the file and rename the backup file.
but before you do make a folder copy the two files to that folder.
and go back and do what I suggested.

well this is the error I get. when I type
sudo gedit /etc/sudoers

>>> sudoers file: syntax error, line 19 <<<
sudo: parse error in /etc/sudoers near line 19

Am I mistaken that there is something wrong with my sudoers file.. Please let me know. Thanks

sybil
08-10-2005, 02:55 PM
Start with this: http://www.pclinuxonline.com/modules.php?mop=modload&name=Splatt_Forums&file=viewtopic&topic=5539&forum=20
It looks like if you're editing the sudoers file, you should use visudo. That way if there's a syntax error it will warn you before you save.
More reading:
http://freedomink.org/node/3
http://aplawrence.com/Basics/sudo.html

Now from what I understand, visudo is an offshoot to the vi editor, which can be a little confusing if you've never used it. Basically, to edit, you have to be in "insert" mode. Just type i and you will see the word insert come up. Make your changes, hit escape to get out of that mode. To exit, this article explains your different options under "Getting out of Vi". Also goes over the basics.
http://www.eng.hawaii.edu/Tutor/vi.html#intro

Superman3332001
08-10-2005, 05:24 PM
Start with this: http://www.pclinuxonline.com/modules.php?mop=modload&name=Splatt_Forums&file=viewtopic&topic=5539&forum=20
It looks like if you're editing the sudoers file, you should use visudo. That way if there's a syntax error it will warn you before you save.
More reading:
http://freedomink.org/node/3
http://aplawrence.com/Basics/sudo.html

Now from what I understand, visudo is an offshoot to the vi editor, which can be a little confusing if you've never used it. Basically, to edit, you have to be in "insert" mode. Just type i and you will see the word insert come up. Make your changes, hit escape to get out of that mode. To exit, this article explains your different options under "Getting out of Vi". Also goes over the basics.
http://www.eng.hawaii.edu/Tutor/vi.html#intro
This may sound like a stupid question so please forgive me. b4 I start editing. How do I save it when I am done

sybil
08-10-2005, 11:40 PM
:wq exit and save
:q exit - no save - will prompt if document has changed
:q! exit - no save - no prompt
In order to exit, you need to be in command mode. Hit escape to be sure.

Ken_ver_1_5
08-11-2005, 11:44 AM
:wq exit and save
:q exit - no save - will prompt if document has changed
:q! exit - no save - no prompt
In order to exit, you need to be in command mode. Hit escape to be sure.

good advice Sybil I once got stuck in vi took me some time
to figure out how to get out:)

Superman3332001
08-11-2005, 11:52 AM
:wq exit and save
:q exit - no save - will prompt if document has changed
:q! exit - no save - no prompt
In order to exit, you need to be in command mode. Hit escape to be sure.
What format is the original saved as

Thanks.

Ken_ver_1_5
08-11-2005, 01:15 PM
not knowing the file I would say since you edited it, it was plain text.
but then I could be wrong.
the reason I say this is I have been editing a file (smb.conf) and it says
in the editor that its plain text. but if I look at the file in windows note pad
it looks like gibberish not plain text. at any rate when you save it it should have the correct name.
I feel like the blind leading the blind as I am too a new user of linux.
and I am very thankful we have Sybil to set us strait:)
I try to help as I am learning too so take two grains of salt with my input:)

again thank you Sybil

Superman3332001
08-11-2005, 04:45 PM
not knowing the file I would say since you edited it, it was plain text.
but then I could be wrong.
the reason I say this is I have been editing a file (smb.conf) and it says
in the editor that its plain text. but if I look at the file in windows note pad
it looks like gibberish not plain text. at any rate when you save it it should have the correct name.
I feel like the blind leading the blind as I am too a new user of linux.
and I am very thankful we have Sybil to set us strait:)
I try to help as I am learning too so take two grains of salt with my input:)

again thank you Sybil
So does anyone know which file extension I should save it under is it
Dos format. append, back up file , to files, mac format, prepend

Thanks

I waited quite awhile to see if anyone knew how to fix it and I just gave up and re-installed ubuntu and everything is pretty well back to normal now. Thanks everyone for your suggestions