5.用户及权限
来源:互联网 发布:mac win8u盘安装 编辑:程序博客网 时间:2024/06/10 07:29
*info about account
syntax: id
*change password
styntax: passwd
*files about account/group
/etc/passwd account
/etc/shadow password
/etc/group group
*View current users
whoami -show the current user
who -show all users who are using this server
w -show all users who are using this server and what they are doing
*how to create a new user
syntax: useradd newusername
*add password for account
syntax: passwd [option] username
option:
-d home directory
-s shell
-u userId
-g main group
-G Other groups (seperate by ",")
*modify account
syntax: usermod [option] username
option: -lnewusername
-unew userId
-dnew home directory
-gmain group
-Gother groups
-Llock the account
-Uunlock the account
*delete account
syntax: userdel [option] username
option: -r delete home directory
example: userdel test (delete account test but not delete its home directory)
userdel -r test (delete account test and delete its home directory)
*add group
syntax: groupadd groupname
*modify group
syntax: groupmod [option]
option:-n newname oldname (change group name)
-g newGid oldGid (change groupId)
*delete group
syntax: groupdel groupname
*use command "chown" to change owner of file/directory
syntax: chown account file
chown -R account directory
*use command "chgrp" to change group of file/directory
syntax: chgrp group file
chgrp -R group directory
*use command "chmod" to change permission of file/directory
syntax: chmod [option] file
chmod -R [option] directory
option:
u,g,o represent user,group,other
a represent ugo
+,- represent add,del
4,2,1 represent r,w,x
example:
chmod u+rw filename
chmod g-x fileanme
chmod go+r filename
chmod a-x filename
chmod 660 filename (change permission to rw-rw----)
*default permission of file/directory
default file permission: 777-umask
default directory permission: 666-umask
syntax: umask (show umask)
umask newnumber (change umask)
*special right
suid (let exec file run as it owner's right)
syntax: id
*change password
styntax: passwd
*files about account/group
/etc/passwd account
/etc/shadow password
/etc/group group
*View current users
whoami -show the current user
who -show all users who are using this server
w -show all users who are using this server and what they are doing
*how to create a new user
syntax: useradd newusername
*add password for account
syntax: passwd [option] username
option:
-d home directory
-s shell
-u userId
-g main group
-G Other groups (seperate by ",")
*modify account
syntax: usermod [option] username
option: -lnewusername
-unew userId
-dnew home directory
-gmain group
-Gother groups
-Llock the account
-Uunlock the account
*delete account
syntax: userdel [option] username
option: -r delete home directory
example: userdel test (delete account test but not delete its home directory)
userdel -r test (delete account test and delete its home directory)
*add group
syntax: groupadd groupname
*modify group
syntax: groupmod [option]
option:-n newname oldname (change group name)
-g newGid oldGid (change groupId)
*delete group
syntax: groupdel groupname
*use command "chown" to change owner of file/directory
syntax: chown account file
chown -R account directory
*use command "chgrp" to change group of file/directory
syntax: chgrp group file
chgrp -R group directory
*use command "chmod" to change permission of file/directory
syntax: chmod [option] file
chmod -R [option] directory
option:
u,g,o represent user,group,other
a represent ugo
+,- represent add,del
4,2,1 represent r,w,x
example:
chmod u+rw filename
chmod g-x fileanme
chmod go+r filename
chmod a-x filename
chmod 660 filename (change permission to rw-rw----)
*default permission of file/directory
default file permission: 777-umask
default directory permission: 666-umask
syntax: umask (show umask)
umask newnumber (change umask)
*special right
suid (let exec file run as it owner's right)
阅读全文
0 0
- 5.用户及权限
- 的用户及权限
- 用户及权限管理
- Linux用户及权限
- linux用户及权限
- 用户及权限管理
- 用户及文件权限
- [PHP]用户及权限管理
- SQL的用户及权限
- SVN用户及权限配置
- Oracle查看用户及权限
- MySQL - 用户及权限管理
- MySQL - 用户及权限管理
- MySQL - 用户及权限管理
- Oracle 用户及权限设置
- MySQL - 用户及权限管理
- 用户登录及权限设置
- mysql用户及权限常用命令
- 3.4Linux 文件系统挂载
- 数据对接—kettle使用知识15
- 4.Linux获取帮助
- K-means聚类
- 关于Activiti多级审批自动绘图以及修改class方面的经验
- 5.用户及权限
- MAC环境如何将本地代码上传到GitHub上
- Object.create()方法的使用
- 7.1 管道、重定向
- Map的KEY值转成大写
- 实体类对象与XML字符串的序列化和反序列化(示例)
- 7.2 Linux 命令行文本处理
- 最佳日志数据实践
- windows 的常用命令