Changing Shell From Bash to Fish

I followed a generic guide & system failed to accept user credentials. I am aware openSUSE is as functional as Ubuntu, but many of the tricks & tips are hard to find, if not well documented. (There is a command to change hostname & a command to change Plymouth, is there a tipster swapsie) or by way of education, a way to change the default shell?!?

I’m not aware of any.

However, any user should be able to change shell (for that user).

chsh -s /usr/bin/fish

DO NOT try that as root. Best not to change the root shell.

When you are loged in using a shell, you can call another shell and from then on you use that shell until you log out and then change back to your original shell. Example:

henk@boven:~> ksh
henk@boven:/home/henk> csh
Directory: /home/henk
/home/henk% exit
exit
henk@boven:/home/henk> exit
henk@boven:~>

The first prompt is the bash one, the second is the ksh one, then the csh prompt and back again.

When you are loged in using a shell, you can replace that shell (more or less “on the spot”) with the exec command. Example:

henk@boven:~> exec ksh
henk@boven:/home/henk> exit

When I now hit return after that exit, my session will be finished.

When you want to change your login shell (the one you use after a login), you use @nrickert advice with chsh. Also see of course

man chsh

BTW that login shell is configured in /etc/passwd (and thus root can also change this by direct editing).

henk@boven:/home/henk> grep henk /etc/passwd
henk:x:1000:1000:Henk van Velden:/home/henk:/bin/bash
henk@boven:/home/henk>

(last field of the entry).

That command changed shell for root & not user. Changing via /etc/passwd results in unable to login as that user.

Then you have used that command as root, not user!

And then please SHOW what is now in /etc/passwd. How do you think we can correct errors when we do not see them.

/etc/passwd:

avahi:x:498:497:User for Avahi:/run/avahi-daemon:/bin/false
bin:x:1:1:bin:/bin:/sbin/nologin
chrony:x:485:474:Chrony Daemon:/var/lib/chrony:/bin/false
daemon:x:2:2:Daemon:/sbin:/sbin/nologin
dnsmasq:x:493:65533:dnsmasq:/var/lib/empty:/bin/false
firebird:x:495:480:Firebird SQL server:/srv/firebird:/bin/bash
flatpak:x:496:495:User for flatpak system helper:/:/sbin/nologin
lightdm:x:478:467:LightDM daemon:/var/lib/lightdm:/bin/false
lp:x:492:484:Printing daemon:/var/spool/lpd:/sbin/nologin
mail:x:497:496:Mailer daemon:/var/spool/clientmqueue:/sbin/nologin
man:x:13:62:Manual pages viewer:/var/lib/empty:/sbin/nologin
messagebus:x:499:498:User for D-Bus:/run/dbus:/usr/bin/false
mysql:x:60:499:MySQL database admin:/var/lib/mysql:/bin/false
nm-openconnect:x:480:469:NetworkManager user for OpenConnect:/var/lib/nm-openconnect:/sbin/nologin
nm-openvpn:x:481:470:NetworkManager user for OpenVPN:/var/lib/openvpn:/sbin/nologin
nobody:x:65534:65534:nobody:/var/lib/nobody:/bin/bash
nscd:x:488:476:User for nscd:/run/nscd:/sbin/nologin
polkitd:x:491:478:User for polkitd:/var/lib/polkit:/sbin/nologin
postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
pulse:x:484:473:PulseAudio daemon:/var/lib/pulseaudio:/sbin/nologin
root:x:0:0:root:/root:/bin/bash
rpc:x:490:65534:user for rpcbind:/var/lib/empty:/sbin/nologin
rtkit:x:487:475:RealtimeKit:/proc:/bin/false
scard:x:483:471:Smart Card Reader:/var/run/pcscd:/usr/sbin/nologin
sddm:x:477:466:SDDM daemon:/var/lib/sddm:/bin/false
sshd:x:489:477:SSH daemon:/var/lib/sshd:/bin/false
statd:x:486:65533:NFS statd daemon:/var/lib/nfs:/sbin/nologin
tftp:x:494:479:TFTP account:/srv/tftpboot:/bin/false
usbmux:x:482:65533:usbmuxd daemon:/var/lib/usbmuxd:/sbin/nologin
vnc:x:479:468:user for VNC:/var/lib/empty:/sbin/nologin
fleamour:x:1000:100:fleamour:/home/fleamour:/usr/bin/fish
systemd-coredump:x:995:995:systemd Core Dumper:/:/usr/sbin/nologin
systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
systemd-resolve:x:997:997:systemd Resolver:/:/usr/sbin/nologin
systemd-timesync:x:996:996:systemd Time Synchronization:/:/usr/sbin/nologin
fleamour@G41M-COMBO:~> chsh -s /usr/bin/fish
Password: 
chsh: PAM: Authentication failure

Using Sudo changes for root. Not using sudo results in authentication error.

I have no /usr/bin/fish on my system. Did you install that extra?

And I see it asks for a password, that stumbles me. Who’s password did you provide?

So, I did it myself:

mgi:x:1002:100:Machine Generated Information:/home/mgi:/bin/bash
mgi@boven:~> chsh -s /usr/bin/ksh
Password: 
mgi@boven:~> grep mgi /etc/passwd
mgi:x:1002:100:Machine Generated Information:/home/mgi:/usr/bin/ksh
mgi@boven:~>

Indeed, it asks for my password (I am not sure why, but the tool designer apperently was afraid that some passerby did this when you was away to the bathroom).

And it works as intended

Did you try to read chsh manual page? “chsh -s /usr/bin/fish your-user-name“

You are of course correct that that is the way for root to do it.

But this is a change for the user that can be done by the user. No root needed. And we all know: you never should do things as root that do not need to be done by root.

Yes, fish shell is installed. Both “Password” & my user password do not work, although root is the same as my user password? At least I can su - login with it. I get a PAM authentication error each time I try chsh -s /usr/bin/fish (with or without) fleamour.

Fish is listed under /etc/shells.

Maybe it no likey fish?!?

:disapointed:

We can not check what you do when you do not copy/paste and post between CODE tags in a post, complete (inclusing prompt command lines, all output, up to and inclusing the last prompt line.

As one here once said: we do not trust your stories, we trust only computer texts.

fleamour@G41M-COMBO:~> sudo nano /etc/shells
/bin/ash
/bin/bash
/bin/csh
/bin/dash
/bin/false
/bin/ksh
/bin/ksh93
/bin/mksh
/bin/pdksh
/bin/sh
/bin/tcsh
/bin/true
/bin/zsh
/usr/bin/csh
/usr/bin/dash
/usr/bin/ksh
/usr/bin/ksh93
/usr/bin/mksh
/usr/bin/passwd
/usr/bin/pdksh
/usr/bin/bash
/usr/bin/tcsh
/usr/bin/zsh
/usr/bin/fish
/usr/bin/scsh
/usr/bin/rash

fleamour@G41M-COMBO:~> chsh -s /usr/bin/fish fleamour
Password: 
chsh: PAM: Authentication failure

fleamour@G41M-COMBO:~> chsh -s /usr/bin/fish
Password: 
chsh: PAM: Authentication failure

fleamour@G41M-COMBO:~> sudo nano /etc/shells



/bin/ash
/bin/bash
/bin/csh
/bin/dash
/bin/false
/bin/ksh
/bin/ksh93
/bin/mksh
/bin/pdksh
/bin/sh
/bin/tcsh
/bin/true
/bin/zsh
/usr/bin/csh
/usr/bin/dash
/usr/bin/ksh
/usr/bin/ksh93
/usr/bin/mksh
/usr/bin/passwd
/usr/bin/pdksh
/usr/bin/bash
/usr/bin/tcsh
/usr/bin/zsh
/usr/bin/fish
/usr/bin/scsh
/usr/bin/rash



There is no neeed to do that as root. Just a

cat /etc/shells

is enough.

The first form is nonsense as you do this as fleamour.

In any case, you seem not to be able to type fleamour’s password. Are you fleamour? Why do you not know his password. Which password do you use when you login as fleamour?

How do we know you are Henk Van Helden? Maybe she popped out & this is her maid? :grin:

My password is 123456. I am fleamour. Fleamours password is 123456. Hey, maybe you like donkeys. Donkeys are pretty cool. The wild donkey has no boss & lives in the wilderness.

It looks as if something is broken in your PAM stack.

I tried that here (in Tumbleweed), and it works just fine. I used the password of the logged in user.

Then, after experimenting, I conclused that I don’t like “fish”. So I changed it back.

Chris Fisher of LAS fame recommended it. I like the fuzzy search. I tried out openSUSE KDE on his recommendation & stayed ever since.

I wanted to trial fuzzy search. Chris Fisher of LAS fame recommended it. I tried openSUSE on his recommendation as best KDE distro & stayed ever since.

When I use a wrong passwd:

mgi@boven:~> chsh -s /usr/bin/ksh
Password: 
chsh: PAM: Authentication failure
mgi@boven:~>

There seem to be two causes suggested above:

  1. a software problem with PAM;
  2. simply typed an incorrect passwd.

Ockhams razor?