1

Suppose that I have a mini-shell, named minish which provides only cd, ls, rm, mkdir, etc. minish is saved in ~/Desktop/Shell. It can be used from other shell, such as bash, by calling just ~/Desktop/Shell/minish. It works well.

But to use it as the login shell, I added ~/Desktop/Shell/minish at the bottom of /etc/shells and execute chsh and typed ~/Desktop/Shell/minish, but it says minish is an invalid shell.

I guessed 2 possibilities of this error:

  • Because minish is not in /bin since other shells are all in /bin.
  • Because there are some qualifications to be called as a shell, so not any executable file can not be a shell, my minish either.

If the second case is the reason, what are those qualifications or necessaries and how chsh checks this conditions? Or is there any other reason?

Thank you.

Analysis
  • 113
  • 2

1 Answers1

4

You put ~/Desktop/Shell/minish verbatim in /etc/shells; the expansion of ~ is a shell feature and likely unsupported by whatever application parses /etc/shells, because it wouldn't know, to whose home directory ~ is supposed to refer. Instead, you need to use the full path name, e. g. /home/analysis/Desktop/Shell/minish.

David Foerster
  • 36,890
  • 56
  • 97
  • 151