用户概览

来源:互联网 发布:端面铣数控怎样编程 编辑:程序博客网 时间:2024/05/29 12:33

用户和组的基本概念

Users and groups:
. Every process (running program) on the system runs as a particular user.
系统上的每个进程(运行的程序)都是作为特定用户运行的
. Every file is owned by a particular user.
每个文件是由一个特定的用户拥有
. Access to files and directories are restricted by user.
访问文件和目录受到用户的限制
. The user associated with a running process determines the files and directories accessible to that process.
与正在运行的进程相关联的用户确定该进程可访问的文件和目录

查看当前登录的用户信息:
[root@w_hat ~]# id
uid=0(root) gid=0(root) groups=0(root)

查看文件的owner:
[root@w_hat ~]# ll /home/
total 0
drwx——. 5 wp wp 144 7月 27 15:03 wp

查看运行进程的username:
[root@w_hat ~]# ps aux |less (less可以分页查看)
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 3 0.0 0.0 0 0 ? S 06:27 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S 06:27 0:00 [kworker/0:0]
root 5 0.0 0.0 0 0 ? S< 06:27 0:00 [kworker/0:0H]

[root@w_hat ~]# yum -y install httpd
[root@w_hat ~]# systemctl start httpd
[root@w_hat ~]# ps aux |grep httpd
root 1794 0.0 0.0 491540 16656 ? Ss 06:28 0:00 /usr/sbin/httpd -DFOREGROUND
apache 1955 0.0 0.0 503672 23924 ? S 06:28 0:01 /usr/sbin/httpd -DFOREGROUND
apache 1956 0.0 0.0 514328 34120 ? S 06:28 0:03 /usr/sbin/httpd -DFOREGROUND
apache 1957 0.0 0.0 507968 27404 ? S 06:28 0:01 /usr/sbin/httpd -DFOREGROUND
apache 3534 0.2 0.0 530140 49624 ? S 07:44 0:04 /usr/sbin/httpd -DFOREGROUND
apache 3535 0.1 0.0 503672 23300 ? S 07:44 0:01 /usr/sbin/httpd -DFOREGROUND
apache 3536 0.2 0.0 522128 40228 ? S 07:44 0:03 /usr/sbin/httpd -DFOREGROUND
apache 3537 0.1 0.0 503872 23608 ? S 07:44 0:01 /usr/sbin/httpd -DFOREGROUND
apache 3746 0.0 0.0 511368 30368 ? S 07:56 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3866 0.0 0.0 505480 24392 ? S 08:02 0:00 /usr/sbin/httpd -DFOREGROUND
apache 3869 0.0 0.0 505472 24332 ? S 08:02 0:00 /usr/sbin/httpd -DFOREGROUND

和用户组相关的一些文件:
/etc/passwd root:x:0:0:root:/root:/bin/bash 用户信息
用户名:x:uid:gid:描述:HOME:shell x密码占位符
/etc/shadow root:$1$MYG2NDG6$a1wtyr5GDM2esAPjug0YP0:15636:0:99999:7:: : 密码信息

    $id$salt$encrypted 

/etc/group root:x:0: 组信息

[root@w_hat ~]# man 5 passwd
[root@w_hat ~]# man 5 shadow
[root@w_hatn ~]# man 5 group
[root@w_hat ~]# man 3 crypt

系统约定: centos7
uid: 0 特权用户
uid: 1~1000 系统用户
uid: 1000+ 普通用户

The root user
. uid is 0
UID是0
. all power
所有权力
. This user has the power to override normal privileges on the file system
该用户有权力覆盖文件系统上的普通权限
. installing or removing software and to manage system files and directorie
安装或删除软件并管理系统文件和目录
. Most devices can only be controlled by root
大多数设备只能由root控制

原创粉丝点击