Locked out after .bashrc edit

9 views
Skip to first unread message

Ross Elliot

unread,
Jan 20, 2019, 5:09:15 AM1/20/19
to Vagrant

I have a vagrant box running under the default user vagrant. I access the shell with Putty and a secure key.


I added this command to the end of .bashrc


if [[ ! $TERM =~ screen ]]; then
    exec tmux
fi


in an effort to start tmux automatically when I start a session. But now the shell exists when it loads tmux. I don't get a chance to do anything before it exits.


I have tried: vagrant ssh -c /bin/sh but the connection closes immediately.


With vagrant ssh -p I get asked for a password but "vagrant" doesn't work.


How can I get into my box to at least disable the .bashrc file?


On the other hand, can I roll my box back to the last suspended state, which was before I made the edit? I haven't reloaded as that will save the current state with the fatal edit.



Alvaro Miranda Aguilera

unread,
Jan 29, 2019, 1:32:54 PM1/29/19
to vagra...@googlegroups.com
you can use the vagrant way, which i a bit extreme


vagrant destroy
vagrant up

or you can try over the console/ssh as other user, not sure what box you use, so may or may not work

root/root
root/ubuntu

Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/8c260812-7155-451e-8a45-562e6c5781c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages