Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

"Segmetation fault" after modifing .bashrc as a rootuser

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
MaxTH
Posts: 6
Joined: 2017-10-26 01:26

"Segmetation fault" after modifing .bashrc as a rootuser

#1 Post by MaxTH »

I think i've broke my debian bad, wasn't following instruction closely... need to learn how to read again. I was trying to get color-coding to work in my terminal (different colors for directories, files, exec and such) and modified .bashrc file in "/", root (not the super user) by adding something, i already forgot what to it, i think it was " source ~/.bashrc "
everything else was commented out. Now I can't use sudo -s command, after punching in password it give me: Segmentation fault and kicks me back to regular user $. I've tried to open .bashrc with nano and vim, but both show nothing, nano says "Directory '.' is not writable" so i can't even show what i've done. Is there any cure for that?

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#2 Post by reinob »

MaxTH wrote:I think i've broke my debian bad, wasn't following instruction closely... need to learn how to read again. I was trying to get color-coding to work in my terminal (different colors for directories, files, exec and such) and modified .bashrc file in "/", root (not the super user) by adding something, i already forgot what to it, i think it was " source ~/.bashrc "
everything else was commented out. Now I can't use sudo -s command, after punching in password it give me: Segmentation fault and kicks me back to regular user $. I've tried to open .bashrc with nano and vim, but both show nothing, nano says "Directory '.' is not writable" so i can't even show what i've done. Is there any cure for that?
You probably f*cked up root's .bashrc (by telling it to source itself..)
You just need to get root without running bash, i.e. don't do "sudo -s" (which will run root's shell), but just "sudo /bin/sh", which should not run .bashrc.

Then fix your mess.

User avatar
Soapm
Posts: 603
Joined: 2012-05-22 04:23
Has thanked: 1 time

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#3 Post by Soapm »

Also, you can boot your rig with a live CD and replace the file in question with a default file. The one on the live CD should work.

MaxTH
Posts: 6
Joined: 2017-10-26 01:26

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#4 Post by MaxTH »

already reinstall the system, couldn't wait :lol: But thank you guys! I really appreciate it!
now i'm sad i could try all that stuff you recommended :lol:, very interesting stuff! :)

User avatar
acewiza
Posts: 357
Joined: 2013-05-28 12:38
Location: Out West

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#5 Post by acewiza »

Do it again! :lol:
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 461 times

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#6 Post by sunrat »

Could have just restored the backup of the .bashrc file that you made before editing it. :wink:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

MaxTH
Posts: 6
Joined: 2017-10-26 01:26

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#7 Post by MaxTH »

acewiza wrote:Do it again! :lol:
:lol: No-no-no lesson learned, they tell you to be careful with root, but i guess you need to experience it for your self :lol:

MaxTH
Posts: 6
Joined: 2017-10-26 01:26

Re: "Segmetation fault" after modifing .bashrc as a rootuser

#8 Post by MaxTH »

sunrat wrote:Could have just restored the backup of the .bashrc file that you made before editing it. :wink:
:!: :oops: i usually do back up :wink: Thank you sir! (takes off the hat and bows)

Post Reply