Shell限制应用的方法介绍

分类: 系统管理   出处:iocblog整理  更新时间:2009-02-10   添加到收藏  

  例:限制用户benny只能使用ftp和e-mail服务,而不能使用telnet和ssh登入录
 
  [root@localhost]#vi /etc/passwd
 
  radvd:x:75:75:radvd user:/:/sbin/nologin
 
  amanda:x:33:6:amanda user:/var/lib/amanda:/bin/bash
 
  pegasus:x:66:65:tog-pegasus openpegasus wbem/cim services:/var/lib/pegasus:/sbin/nologin
 
  jimmy:x:501:501::/home/jimmy:/bin/bash
 
  benny:x:502:502::/home/benny:/bin/false //这是修改后将原/bin/bash改为/bin/false
 
  lambert:x:503:503::/home/lambert:/bin/bash
 (文章来源 www.iocblog.net)
  [root@localhost]#vi /etc/shells
 
  /bin/sh
 
  /bin/bash
 
  /sbin/nologin
 
  /bin/ash
 
  /bin/bsh
 
  /bin/ksh
 
  /usr/bin/ksh
 
  /usr/bin/pdksh
 
  /bin/tcsh
 
  /bin/csh
 
  /bin/zsh
 
  /bin/false ////这一行是新增的
 
  备注:我们必须指定falsh或null给该使用者,若仅把shell删除而不加上任何文件,则该使用者登录时,系统会自动启用sh为其预设之shell.
 (文章来源 www.iocblog.net)


Tag: Shell



文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。