• sudo cp bin/* /bin/*
    5 replies, posted
Fuck me. I just wrote [code] sudo cp bin/* /bin/* [/code] into my debian console and now every command says doesn't exist. I boot into rescue mode and everything is still there, but now I can't ssh into it. Is there any way to fix this without reinstalling? D:
Why would you do that? :saddowns: Can you try running commands directly from the /bin directory? Also is this an offsite server, or do you have console access?
[QUOTE=Richard Simmons;51779167]Why would you do that? :saddowns: Can you try running commands directly from the /bin directory? Also is this an offsite server, or do you have console access?[/QUOTE] I have ssh and kvm access to this server Why would I do that? Because i forgot /usr/bin was a thing and i forgot that i shouldn't put * in the second argument I can still run them directly in rescue mode though, which is weird. [editline]5th February 2017[/editline] Also apparently I can't chroot into it as it will say /bin/bash doesn't exist yet it clearly does. [img]http://i.imgur.com/MtihVhN.png[/img]
Did you check file permissions/owner to make sure thats still intact? That KVM might come in use, but for deb theres always debootstrap especially if your permissions are all out of wack. [editline]5th February 2017[/editline] Well scratch that, looks like at least bash is right. Shit....
Well I ran debootstrap to reinstall the core files and it all seems to work now - probably need to redo ssh and stuff though. Thanks for that. [editline]5th February 2017[/editline] [code] cd /mnt/vdb1 sudo apt-get update sudo apt-get install debootstrap debootstrap stable . bash chroot . sudo apt-get install apt-transport-https dbus openssh-server [keep original configs if prompted] systemctl enable ssh.socket sudo update-rc.d ssh defaults exit reboot [/code] all the commands i think i did to get it to work properly again thanks for the debootstrap hint!
Glad it worked out for you. It's gotten me out of a few punches before like when I did chmod 555 * on my root directory. Wildcards really serve as a testament to pay attention on what you're doing :v:
Sorry, you need to Log In to post a reply to this thread.