lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] When chsh doesn't work [Was: RHEL userid puzzlement]


From: Greg Chicares
Subject: Re: [lmi] When chsh doesn't work [Was: RHEL userid puzzlement]
Date: Sat, 7 Mar 2020 16:20:32 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2020-02-06 00:38, Greg Chicares wrote:
> On 2019-09-17 23:31, Greg Chicares wrote:
>> On 2019-09-11 13:03, Vadim Zeitlin wrote:
> 
> [...'chsh' has no effect, and this command:
>    sudo grep `whoami` /etc/passwd
> prints nothing...]
> 
>>>  This depends on the system configuration, /etc/passwd is just one of the
>>> possible sources of the user database and I guess this system uses
>>> something different, e.g. an LDAP or a NIS server.
[...]
>>>  Otherwise, I can only recommend putting "exec zsh" (preferably after
>>> verifying that it's available!) in your ~/.bash_login, e.g. something like
>>> this:
>>> 
>>>     if hash zsh 2> /dev/null; then
>>>             exec zsh -l
>>>     fi
>> 
>> Yup. That's the only convenient way. Others have had this
>> problem, and that's the answer that works:
>>   
>> https://stackoverflow.com/questions/33292541/how-do-i-change-my-default-shell-in-ubuntu-when-not-in-etc-passwd/33292612#33292612
> 
> Okay, there's no ~/.bash_login file, so I modified
> the existing ~/.bash_profile by adding
>   exec /bin/zsh -l
> as its first line. That seems to work well enough.

It is better to add these as the first two lines:

  export SHELL=/bin/zsh
  exec /bin/zsh -l

Otherwise, zsh runs, but:

  $echo $0
  /bin/zsh
  $echo $SHELL
  /bin/bash

Removing that contradiction is a Good Thing, but it alone is not enough for
  schroot --chroot=lmi
to start zsh in the chroot.

  https://manpages.debian.org/testing/schroot/schroot.conf.5.en.html
| shell=shell
|   When running a login shell a number of potential shells will be considered,
| in this order: the command in the SHELL environment variable (if
| --preserve-environment is used, or preserve-environment is enabled),

After briefly experimenting with '--preserve-environment', we've
stopped using it because it caused surprising problems.

| the user's shell in the ‘passwd’ database,

As noted above, this server doesn't have our accounts in /etc/passwd .

| /bin/bash and finally /bin/sh.

That's why we were getting bash.

| This setting overrides this list, and will use the shell specified.

I've altered the configuration accordingly in commit 00c3f13c.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]