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/bash
to /bin/sh
and /bin/sh
links to dash
) in /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.
problem 2
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.
edit 1
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.
Output of ls -l /etc/passwd
is rw-r--r-- root root
If I do cat /etc/passwd
users entry is
user:x:1000:1000:user,,,:/home/user:/bin/dash
ls -l /bin/dash
shows it doesn't point to /bin/bash
. As one answer said to check it.
edit 2
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 /bin/bash
.
Now used 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/sh
is 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/dash
works, 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., withls -l
), but the fact that you got a shell withinit=/bin/dash
really demonstrated thatdash
works. … (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/etc/passwd
withusermod
orchsh
is probably a good idea. (6) Do an octal or hex dump of/etc/passwd
and see whether you typed a space after/bin/dash
.