赞
踩
useradd -m fct
-d 指定用户的家目录(默认用户名目录为/home/用户名,root用户名家目录是/root)
-g 指定用户所属组
-M 不自动建立用户登录的目录(默认的用户登录目录是用户家目录)
-u 指定用户id
passwd fct
# 输入两次密码
nano /home/fct/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export FCT_HOME=/fct
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
cd $FCT_HOME
# 创建用户组web
groupadd web
# 将用户fct添加到用户组web
usermod -a -G web fct
# 编辑用户组权限
visudo
在文件的最后添加:
%web ALL=(ALL:ALL) /usr/bin/apt-get,/usr/bin/apt
nano /etc/passwd
找到刚创建的用户,将最后的/bin/sh调整为/bin/bash
fct:x:1001:1001::/home/fct:/bin/bash
# root执行,将/btc及其子目录的所有分组切换为web
chgrp -R web /btc
# root执行,将/btc及其子目录的分组权限调整为wrx
chmod -R 775 /btc
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。