jydg 发表于 2018-8-19 14:18:42

小计一下(Restricted shell)

# useradd test                # 添加用户  
# cd bin
  
# ln -s bash rbash            # 设置软连接
  
# cd /home/test
  
# vim .bash_profile
  
    # .bash_profile
  

  
    # Get the aliases and functions
  
    if [ -f ~/.bashrc ]; then
  
            . ~/.bashrc
  
    fi
  
    # User specific environment and startup programs
  

  
    #PATH=$PATH:$HOME/bin   # 注释掉原来的PATH路径
  
    PATH=$HOME/.bin
  

  
    export PATH
  
# mkdir .bin
  
# ln -s /bin/ls .bin/
  
# ln -s /bin/cat .bin/
  
# ln -s /bin/touch .bin/      # 给用户指定命令
  

  
#
  
# vim /etc/passwd
  
    test:x:502:502::/home/test:/bin/rbash      # 修改shell为rbash
  

  
#
  
# passwd test


页: [1]
查看完整版本: 小计一下(Restricted shell)