I am having linux mint 18. I accidentally removed
/bin/bash. So just after removing it I changed the default shell of the user from terminal (from
/bin/sh links to
/etc/passwd. Now After reboot I am stuck in login loop. After typing credential get blank screen for 10 seconds again get same login screen. Also
tty1 tty2... are not working. As I enter my credential they disappears and again get same thing on these terminals.
When I enter in recovery mode I am getting the same login screen as normal user. I am not getting recovery mode options. It just brings me to login screen.
I pressed e at the grub menu and I added
rw init=/bin/dash at the end of line where linux /boot/vmlinuz.... is written.
ls -l /etc/passwd is
rw-r--r-- root root
If I do
cat /etc/passwd users entry is
ls -l /bin/dash shows it doesn't point to
/bin/bash. As one answer said to check it.
I downloaded bash package in my windows system, copied to external hard disk and then copied it from hard disk to linux system. Compiled and installed it. Copied executable to
chsh -s /bin/bash user
Now I can go into recovery mode it works fine.I can use
tty1.. they also work fine.I can switch to user using
su user in
tty1 and it works fine. If I do
echo $SHELL it says
/bin/bash, but still can't go into graphical environment.Neither guest nor user can log into graphical system.User can use terminal easily it works there but can't use graphical environment.
/bin/shis not work. Can you describe the login loop a bit more? Do you get a message before the prompt comes back? Maybe the screen is cleared so you can't read anything ?
-rw-r--r--, or 644). If you can ssh to your machine, you probably can run commands one by one (unsure) / scp bash.
init=/bin/dashworks, that’s good too. Use whichever you find more appropriate or convenient. (3) Buddika suggested that there might be a problem with
/bin/dash. It’s good to check multiple ways (e.g., with
ls -l), but the fact that you got a shell with
init=/bin/dashreally demonstrated that
dashworks. … (Cont’d)
/etc/passwd, (a) as a backup (in case you make things worse), and (b) so you can examine it at your leisure later. (5) Fixing
chshis probably a good idea. (6) Do an octal or hex dump of
/etc/passwdand see whether you typed a space after