"Segmetation fault" after modifing .bashrc as a rootuser

New to Debian (Or Linux in general)? Ask your questions here!

"Segmetation fault" after modifing .bashrc as a rootuser

Postby MaxTH » 2017-10-26 01:32

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?
MaxTH
 
Posts: 4
Joined: 2017-10-26 01:26

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

Postby reinob » 2017-10-26 05:18

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.
reinob
 
Posts: 521
Joined: 2014-06-30 11:42

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

Postby Soapm » 2017-10-26 06:01

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.
User avatar
Soapm
 
Posts: 494
Joined: 2012-05-22 04:23

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

Postby MaxTH » 2017-10-26 08:47

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! :)
MaxTH
 
Posts: 4
Joined: 2017-10-26 01:26

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

Postby acewiza » 2017-10-26 21:27

Do it again! :lol:
Nobody would ever ask questions If everyone possessed encyclopedic knowledge of the man pages.
User avatar
acewiza
 
Posts: 267
Joined: 2013-05-28 12:38
Location: Out West

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

Postby sunrat » 2017-10-26 23:22

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!
User avatar
sunrat
 
Posts: 2041
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

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

Postby MaxTH » 2017-10-27 04:47

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: 4
Joined: 2017-10-26 01:26

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

Postby MaxTH » 2017-10-27 04:56

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)
MaxTH
 
Posts: 4
Joined: 2017-10-26 01:26


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable