0

I would define the program run for the user at session initiation into /usr/bin/false in /etc/passwd. The default value parameter is /usr/bin/ksh.

When I try to modify it with commands:

bash-5.1# usermod -s /usr/bin/false test1
Check "/etc/security/login.cfg" file.
Error changing "shell" to "/usr/bin/false" : Value is invalid.
bash-5.1# chuser shell="/bin/false" test1
Check "/etc/security/login.cfg" file.
Error changing "shell" to "/bin/false" : Value is invalid.
bash-5.1# chsh test1 /usr/bin/false
Error setting shell for "test1" to "/usr/bin/false" : Value is invalid.

So, all commands are giving the same error. Does IBM AIX 7.2 not support /usr/bin/false?

When I check the available options, I get this:

bash-5.1# chsh  test1
 Current available shells:
                /bin/sh
                /bin/bsh
                /bin/csh
                /bin/ksh
                /bin/tsh
                /bin/ksh93
                /usr/bin/sh
                /usr/bin/bsh
                /usr/bin/csh
                /usr/bin/ksh
                /usr/bin/tsh
                /usr/bin/ksh93
                /usr/bin/rksh
                /usr/bin/rksh93
                /usr/sbin/sliplogin
                /usr/sbin/uucp/uucico
                /usr/sbin/snappd
 test1's current login shell:
                /usr/bin/ksh
 Change (yes) or (no)? > no

Any idea please thanks.

2 Answers 2

1

Available shells are listed in /etc/shells. You most probably only need to add /usr/bin/false there.

1

I discovered that the login shell attribute is defined in the login.cfg file located at /etc/security/login.cfg. This attribute is utilized by the chsh command to determine the available shell options for a user. The value is a list of comma-separated full path names. The default includes /usr/bin/sh, /usr/bin/bsh, /usr/bin/csh, /usr/bin/ksh, or /usr/bin/tsh.

For more detailed information, I found these articles to be quite helpful and explanatory. They cover everything you need to know." https://www.ibm.com/docs/en/aix/7.1?topic=files-logincfg-file https://www.ibm.com/docs/en/aix/7.2?topic=c-chsh-command

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .