Ask Your Question
2

How can I bypass /home/.bashrc so I can fix a mistake in it?

asked 2019-03-31 15:46:51 -0600

waynebuck gravatar image

I have Fedora 28 installed. The only username is 'vm' and this user has root privileges (or at least I can run sudo). I was trying to alter my .bashrc script to make changes to a drive's permissions and unwisely used sudo setfacl -b /media/run/vm Now when it boots, I get to login as usual, but then it all goes to a black screen and I never can move beyond this. If I hit the power button to trigger shutdown, the screen flashes with a prompt for the password for the sudo command followed by the text that it is shutting down. There is no opportunity to enter the password.

I've tried Ctrl-C and just typing the password in on the black screen, but nothing gets me past this point.

I've tried to read about emergency modes and other boot options, but it always just seems to hang for several minutes on the white fedora logo when I try to boot this way. Should I just be more patient?

I tried logging in as 'root', but it doesn't accept the password for 'vm' and it doesn't accept a blank password. The company that set up my box did not send me a Fedora boot CD that I know of. I don't know if 'root' has a password that would get me past the .bashrc problem.

Anyway, I'm really stuck and would appreciate advice on how to get the system to a point where I can remove the sudo lines from the .bashrc file and be able to start up the thing again.

Thanks

Wayne

edit retag flag offensive close merge delete

Comments

Actually the sudo commands were entered into the /home/vm/.bash_profile file, not .bashrc

waynebuck gravatar imagewaynebuck ( 2019-03-31 18:07:39 -0600 )edit

3 Answers

Sort by » oldest newest most voted
3

answered 2019-03-31 18:12:19 -0600

waynebuck gravatar image

I have solved this problem myself, but post the solution here because I did not find it elsewhere.

After logging in, the screen goes black. This would evidently be terminal screen #2. It is possible to switch between terminal screens as, CTRL+ALT+F1 takes the user to terminal screen #1 CTRL+ALT+F2 takes the user to terminal screen #2 Both terminal screens 1 and 2 are graphical and couldn't solve this problem. CTRL+ALT+F3 takes the user to a command line screen #3. Screen #3 is waiting for the sudo password, and so on this screen it is possible to enter the password and continue the progression of the boot into the graphical shell. However, I was able to stay in the terminal screen #3 and navigate to /home/vm and run the vi editor to change .bash_profile I deleted the troublesome lines from .bash_profile (type ':x' to exit saving changes and ':q' to exit discarding changes). The system now boots fine.

edit flag offensive delete link more
0

answered 2019-04-06 14:51:23 -0600

demus gravatar image

Another way of cleaning up a file which has been "ruined" is by booting into a live environment and from there go to the file to alter it. Have done so several times, works great. If you need to (un)install something you need to chroot into the original version and do your thing.

edit flag offensive delete link more
0

answered 2019-03-31 19:22:25 -0600

sideburns gravatar image

Welcome to ask.fedora! Now that you've got things working again, you might want to set a real root password in case something like this ever comes up again. Open a terminal and run this:

sudo passwd root

Enter your password as you normally would. Then, passwd will prompt you for a new password for root, and ask you to confirm it. Now, if for any reason you can't log in as yourself, you can always switch to a CLI console, lot in as root and do what's needed to get things working again.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-03-31 15:46:51 -0600

Seen: 93 times

Last updated: Mar 31 '19