linux系统/etc/shells文件用途
/etc/shells文档主要用途
始终对/etc/shells这一文档的功效并不是太清晰,近期挤时间查了查,小结给出。
$ man shells
SHELLS(5) Linux Programmer’s Manual SHELLS(5)
NAME
shells - pathnames of valid login shells
DESCRIPTION
/etc/shells is a text file which contains the full pathnames of valid login shells.
This file is consulted by chsh(1) and available to be queried by other programs.
Be aware that there are programs which consult this file to find out if a user is a
normal user. E.g.: ftp daemons traditionally disallow access to users with shells
not included in this file.
EXAMPLE
/etc/shells may contain the following paths:
/bin/sh
/bin/csh
FILES
/etc/shells
SEE ALSO
chsh(1), getusershell(3)
1993-11-21 SHELLS(5)
/etc/shells是1个合理登录shell的目录,在启用chsh更改登录shell时,会查寻这一文档。
[root@winway ~]# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/ksh
[winway@winway ~]$ chsh
Changing shell for winway.
动态口令:
New shell [/bin/bash]: /bin/date
chsh: "/bin/date" is not listed in /etc/shells.
chsh: use -l option to see list
因为/bin/date/没有/etc/shells里,因此用户启用chsh不成功。root启用会出現warning。
[root@winway ~]# echo '/bin/date' >>/etc/shells
[winway@winway ~]$ chsh -l
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/ksh
/bin/date
[winway@winway ~]$ chsh
Changing shell for winway.
动态口令:
New shell [/bin/bash]: /bin/date
Shell changed.
[winway@winway ~]$ grep 'winway' /etc/passwd
winway:x:500:500:ww,isrc,no,no:/home/winway:/bin/date
另一个某些程序流程会依据这一文档来分辨1个客户是不是合理客户,比如FTP服务项目会机构这些shell没有/etc/shells里的客户登录。
相关文章
- 2条评论
- 鸠骨痛言2022-05-28 04:01:03
- g shell for winway.动态口令:New shell [/bin/bash]: /bin/datechsh: "/bin/date" is not listed in /etc/shells.chsh:
- 掩吻一镜2022-05-27 18:59:20
- mes of valid login shellsDESCRIPTION/etc/shells is a text file which contains the full pathnames of valid login shells.This file is con