[arch-general] Why chsh behaviour differs from specified in manpage?
Hi, Today I messed around with zsh and login shells and found a strange thing - when I try to change my own login shell - chsh forbids me to do this: $ chsh -s /bin/bash You may not change the shell for 'kravitz'. $ whoami kravitz So it states, that I can't change login shell for current user, but lets look at manpage: DESCRIPTION The chsh command changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. So this it's either a bug in chsh or in its documentation. Does anyone has the same problem? By the way, is it a typo in manpage: "for her own account"? Who is "her"? if we talk about user, there should be "his". But maybe I'm wrong, since english is definitely not my native language. -- Dmitry S. Kravtsov
On Wednesday 25 Apr 2012 01:20:05 Dmitry S. Kravtsov wrote:
So this it's either a bug in chsh or in its documentation. Does anyone has the same problem?
It seems to be working OK for me. I'm asked for my password, and then the shell is changed in /etc/passwd.
By the way, is it a typo in manpage: "for her own account"? Who is "her"? if we talk about user, there should be "his". But maybe I'm wrong, since english is definitely not my native language.
Some people like to use "her" instead of "him", but it's relatively rare. I think some do this as a philosophical statement of gender equality, but I expect there are other reasons too. Paul
On 2012-04-24 17:20, Dmitry S. Kravtsov wrote:
Today I messed around with zsh and login shells and found a strange thing - when I try to change my own login shell - chsh forbids me to do this:
$ chsh -s /bin/bash You may not change the shell for 'kravitz'. $ whoami kravitz
What is your current shell, as shown by `getent passwd kravitz`? chsh refuses the change if the current shell isn't in /etc/shells; this is noted (a bit unclearly) under "NOTES" in the manpage.
By the way, is it a typo in manpage: "for her own account"? Who is "her"? if we talk about user, there should be "his". But maybe I'm wrong, since english is definitely not my native language.
Since the user's gender is unknown, both 'his' and 'her' are common usage, as well as 'his/her' and singular 'their'; this depends entirely on the writer. (See, for example, <http://english.stackexchange.com/q/48/3635>) -- Mantas M. <grawity@gmail.com>
What is your current shell, as shown by `getent passwd kravitz`? Thank you, it's pointed out, that I accidently set "zsh" as login shell instead of "/bin/zsh", I changed it back to normal and everything works fine now.
I reread the NOTE and it's unclear that CURRENT login shell must be listed in /etc/shells, since I thought that it means NEW login shell must be listed there. Cite: NOTE The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. 25 апреля 2012 г. 1:35 пользователь Mantas M. <grawity@gmail.com> написал:
Today I messed around with zsh and login shells and found a strange
On 2012-04-24 17:20, Dmitry S. Kravtsov wrote: thing -
when I try to change my own login shell - chsh forbids me to do this:
$ chsh -s /bin/bash You may not change the shell for 'kravitz'. $ whoami kravitz
What is your current shell, as shown by `getent passwd kravitz`?
chsh refuses the change if the current shell isn't in /etc/shells; this is noted (a bit unclearly) under "NOTES" in the manpage.
By the way, is it a typo in manpage: "for her own account"? Who is "her"? if we talk about user, there should be "his". But maybe I'm wrong, since english is definitely not my native language.
Since the user's gender is unknown, both 'his' and 'her' are common usage, as well as 'his/her' and singular 'their'; this depends entirely on the writer. (See, for example, <http://english.stackexchange.com/q/48/3635>)
-- Mantas M. <grawity@gmail.com>
-- Dmitry S. Kravtsov
"Dmitry S. Kravtsov" <idkravitz@gmail.com> writes:
Hi,
Today I messed around with zsh and login shells and found a strange thing - when I try to change my own login shell - chsh forbids me to do this:
$ chsh -s /bin/bash You may not change the shell for 'kravitz'. $ whoami kravitz
So it states, that I can't change login shell for current user, but lets look at manpage:
DESCRIPTION The chsh command changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account.
Have you messed with PAM? Sounds like you blocked yourself in /etc/pam.d/chsh. -- Carl Lei (XeCycle) Department of Physics, Shanghai Jiao Tong University OpenPGP public key: 7795E591 Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591
On Wed, Apr 25, 2012 at 12:20:52PM +0800, XeCycle wrote:
"Dmitry S. Kravtsov" <idkravitz@gmail.com> writes:
Hi,
Today I messed around with zsh and login shells and found a strange thing - when I try to change my own login shell - chsh forbids me to do this:
$ chsh -s /bin/bash You may not change the shell for 'kravitz'. $ whoami kravitz
So it states, that I can't change login shell for current user, but lets look at manpage:
DESCRIPTION The chsh command changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account.
Have you messed with PAM? Sounds like you blocked yourself in /etc/pam.d/chsh.
Nope, as I already replied here - problem is now resolved. The problem was - I accidently set by root the login shell of my user to "zsh" instead of "/bin/zsh". And according to very unclear note in manpage of chsh - both current and new login shells should be described in /etc/shells. I set a correct login shell for my user by root and now the problem is resolved - chsh works correctly
participants (5)
-
Dmitry Kravtsov
-
Dmitry S. Kravtsov
-
Mantas M.
-
Paul Gideon Dann
-
XeCycle