[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>用户和组的管理
<>用户:
/etc/passwd 用户管理的配置文件
系统用户:用来管理和运行服务,默认不让登录 /sbin/nologin
普通用户:自己创建的用户。
1.添加用户
命令:useradd(如果不指定组,会分配一个同UID的私有组)
2.修改用户信息
3.修改用户家目录
方法1:
在创建用户的同时创建家目录
方法2:
如果未在创建用户同时创建,这时切换用户将会失败
需要进行如下操作:
4.删除用户
userdel -r qwe -r表示同时删除创建用户分配的主目录和邮箱
<>组:
/etc/group
组的分类
私有组:当创建一个用户时,如果没有为这个用户指定基本组,那么用户会自动为自己分配一个同uid的私有组。
基本组:
附加组:除基本组之外,用户还可以被分配到其他组。
创建组
登陆组
修改组
删除组
groupdel
用户加组
gpasswd zuming 给组设置密码
gpasswd -a maomao zu1(组名) 给用户添加组
gpasswd -M xixi,haha,maomao zu2 指定列表的形式将多个用户添加到组
usermod -G zu1 maomao 给maomao用户添加附加组
vim /etc/group 修改配置文件,将用户名添加到组的配置文件中。
gpasswd -A maomao 指定组长
gpasswd -d haha zu1 将haha用户从zu1中移除
vim /etc/group 修改配置文件,将用户名添加到组的配置文件中。
gpasswd -A maomao 指定组长
gpasswd -d haha zu1 将haha用户从zu1中移除
gpasswd -R zu1 锁定指定组,只有组内成员才能进入本组