Last active
November 20, 2017 18:21
-
-
Save harryxu/1470448 to your computer and use it in GitHub Desktop.
Linux new user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new user. | |
adduser username | |
# Add a existing user to existing group. | |
# Add existing user tony to ftp supplementary/secondary group with usermod command using -a | |
# option ~ i.e. add the user to the supplemental group(s). Use only with -G option : | |
usermod -a -G ftp tony | |
# Create a new group. | |
groupadd somegroup | |
# 创建一个只能用ssh key登录不能用密码登录的用户 | |
sudo adduser --disabled-login deploy | |
# 设置目录创建文件时继承目录权限 | |
chmod g+rs folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment