1c7 / VideoList

:us: -> :cn: @糖醋陈皮 翻译的视频列表
https://weibo.com/2004104451
57 stars 11 forks source link

Linux 用户笔记 #70

Open 1c7 opened 9 years ago

1c7 commented 9 years ago

1. 添加用户

有两条命令可以做, 一个是 useradd,一个是 adduser adduser 更好用

更具体的解释:

useradd is native binary compiled with the system. But, adduser is a perl script which uses useradd binary in back-end.

adduser is more user friendly and interactive than its back-end useradd. There's no difference in features provided. http://askubuntu.com/questions/345974/what-is-the-difference-between-adduser-and-useradd

实例:

sudo adduser ftpuser



2. 查看系统当前所有用户

cut -d: -f1 /etc/passwd

http://askubuntu.com/questions/410244/a-command-to-list-all-users-and-how-to-add-delete-modify-users image 我这边运行完之后有超多行,不清楚为什么

查看系统当前有哪些用户登录了



2. 修改密码

passwd 需要root权限

列出所有用户 列出所有用户组 Linux 有 user 和 usergroup

一个 user 可以属于多个 usergroup

https://www.linode.com/docs/tools-reference/linux-users-and-groups