Skip to content

Instantly share code, notes, and snippets.

@harryxu
Last active November 20, 2017 18:21
Show Gist options
  • Save harryxu/1470448 to your computer and use it in GitHub Desktop.
Save harryxu/1470448 to your computer and use it in GitHub Desktop.
Linux new user
# 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