当前位置: 首页 > news >正文

微信公众号里的小网站怎么做的成都网站排名生客seo怎么样

微信公众号里的小网站怎么做的,成都网站排名生客seo怎么样,郑州专业做淘宝网站推广,html5个人网页完整代码转载说明:如果您喜欢这篇文章并打算转载它,请私信作者取得授权。感谢您喜爱本文,请文明转载,谢谢。 接《关于Ansible的模块①》和《关于Ansible的模块②》,继续学习ansible的user模块。 user模块可以增、删、改linux远…

转载说明:如果您喜欢这篇文章并打算转载它,请私信作者取得授权。感谢您喜爱本文,请文明转载,谢谢。


接《关于Ansible的模块①》和《关于Ansible的模块②》,继续学习ansible的user模块。

user模块可以增、删、改linux远程目标节点的用户账户,并为其设置账户的属性。

模块参数

参数可选项&默认值【红色】含义

name【必填参数】

指定要创建/修改/删除的用户名,必填

group

-指定用户属于哪个组

groups

-指定用户属于哪些组

comment

-设置账户描述

home

-指定家目录路径,默认在/home

create_home

true/false是否创建家目录,默认创建,如无需创建则将该参数设置为false

move_home

true/false是否迁移家目录到指定目录

expires

-设置用户到期时间

remove

true/false参数在 state=absent  时使用,删除与用户关联的目录。等价于 userdel --remove,默认值为 false

password

-设置用户密码,不能使用明文方式

password_lock

true/false锁定密码【不会禁用用户】,false表示解锁

update_password

on_create/alwaysalways:如果密码不同,将更新密码
on_create:仅为新创建的用户设置密码

append

true/false默认值是false,用户将只被添加到在指定的组中groups,将他们从所有其他组中删除。可以设置为true,则用户被添加到指定的组里

authorization

-给用户授权,可以使用逗号分隔设置多个授权。可使用 authorization=''删除授权

force

true/false指定账户是否被强制删除,参数在 state=absent  时使用,等价于 userdel --force,默认值为false

ssh_key_bits

-指定要创建的 SSH 密钥中的位数。

ssh_key_comment

-ssh秘钥的注释说明

ssh_key_file

.ssh/id_rsa指定 SSH 密钥文件名,默认为.ssh/id_rsa

ssh_key_passphrase

-设置 SSH 密钥的密码。如果未提供密码,则 SSH  密钥将默认为没有密码

ssh_key_type

rsa指定要生成的 SSH 密钥的类型,默认指为rsa

generate_ssh_key

true/false是否为相关用户生成 SSH  密钥。默认不会覆盖现有的SSH密钥,如需覆盖,则加上force=yes

non_unique

-当与 -u 选项一起使用时,此选项允许将用户 ID 更改为非唯一值

profile

-设置用户的配置文件。可以使用逗号分隔设置多个配置文件。可使用profile=''删除所有配置文件

role

-设置用户的角色,可以使用逗号分隔设置多个角色。可使用role=''删除所有角色

seuser

-选择是否在启用selinux的系统上设置seuser类型(user_u)

shell

-设置用户的默认 shell

state

absent/present无论账号是否应该存在,如果状态与声明不同,则采取措施。选值有  present、absent,默认值为 present

system

true/false指定用户是否为系统用户

uid

-指定uid信息,选填

使用范例

1. 创建一个普通用户

ansible all -m user -a "name=sre"

2. 创建一个用户并指定组

ansible all -m user -a "name=sre group=root"

ansible all -m user -a "name=sre groups=root,test"

3. 给用户设置&修改密码

如果用户不存在,则会新创建用户并设置密码,用户已存在,则会更新密码

# 第一步:先在Python里获得明文密码的密文,例如给用户sre设置密码为123456,则获取123456的密文
[root@test101 ~]# python
Python 2.7.5 (default, Jun 28 2022, 15:30:04) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> import crypt
>>> 
>>> crypt.crypt('123456')  #设置密码123456的密文
'$6$qMFSpDtevYE43QLA$38Bnydh7hNMUMZ1nfYXJxRbJdWTvOOXx7P8e9XptmmyneS.cJOCoOaPGWvMLiVc58kmJ1dlTnhl2kVwe4ZUHN1'
>>> 
>>> exit()
[root@test101 ~]# ##上面的步骤也可以在命令行一步执行:
[root@test101 ~]# python -c 'import crypt,getpass;pw="123456";print(crypt.crypt(pw))'#第二步:设置&修改密码
[root@test101 ~]# ansible all -m user -a "name=sre  password='$6$2JT1ImyA5Qpn7Lgl$4ed2kiN4G3ssPTf0Vi6k0EvjDhQVjZtIGC38pWa0nukMVukH5gGXZEZa.mycDV7aVDAsVWmidulZtvBW2yftO.' update_password=always"
#注意引号的位置,密码用双引号,

登录验证:

4. 设置用户到期时间

设置用户sre到期时间为2024年4月2日00:00分(今日为2024.4.3)

[root@test101 tmp]# date -d 2024-04-02 +%s  #获取对应日期的unix时间戳
1711987200
[root@test101 tmp]# 
[root@test101 tmp]# ansible all -m user -a "name=sre expires=1711987200 comment='expires date is 20240402'"
[root@test101 tmp]# 
[root@test101 tmp]# ssh sre@10.0.0.102
sre@10.0.0.102's password: 
Your account has expired; please contact your system administrator
Authentication failed.
[root@test101 tmp]#

5. 删除一个用户(及其家目录)

ansible all -m user -a "name=sre state=absent" #不删除家目录
ansible all -m user -a "name=sre state=absent remove=yes"  #删除家目录 
#备注:"state=absent"等价于“userdel --remove”,如果远程主机正在以sre用户登录,则会删除失败

6. 为用户生成ssh密钥对

为远程服务器中的sre用户生成ssh密钥对,生成在/home/sre/.ssh(.ssh目录事先不存在会自动创建)目录下,私钥名id_rsa_sre,注释信息"sre rsa",私钥密码123456

ansible all -m user -a 'name=sre generate_ssh_key=yes ssh_key_file=/home/sre/.ssh/id_rsa_sre ssh_key_comment="sre rsa" ssh_key_passphrase=123456'

未完待续......

感谢您的阅读与喜爱!


文章转载自:
http://dinncoplague.ssfq.cn
http://dinncowoolhat.ssfq.cn
http://dinncopetroleuse.ssfq.cn
http://dinnconiersteiner.ssfq.cn
http://dinncoflandre.ssfq.cn
http://dinncoairflow.ssfq.cn
http://dinncororqual.ssfq.cn
http://dinncostandfast.ssfq.cn
http://dinncoparted.ssfq.cn
http://dinncopietermaritzburg.ssfq.cn
http://dinncoitu.ssfq.cn
http://dinncodiscordant.ssfq.cn
http://dinncocomputative.ssfq.cn
http://dinncoadless.ssfq.cn
http://dinncoharquebusier.ssfq.cn
http://dinncotrivialism.ssfq.cn
http://dinncovercelli.ssfq.cn
http://dinncogeminiflorous.ssfq.cn
http://dinncomarsupium.ssfq.cn
http://dinncocentrosphere.ssfq.cn
http://dinncoovercolor.ssfq.cn
http://dinncoaisled.ssfq.cn
http://dinncomorgan.ssfq.cn
http://dinncourethrotomy.ssfq.cn
http://dinncokriegie.ssfq.cn
http://dinncomacilent.ssfq.cn
http://dinncomonostich.ssfq.cn
http://dinncoflightless.ssfq.cn
http://dinncozahle.ssfq.cn
http://dinncokanu.ssfq.cn
http://dinncobant.ssfq.cn
http://dinncotwelfthly.ssfq.cn
http://dinncobailable.ssfq.cn
http://dinncoxanthomelanous.ssfq.cn
http://dinncoproctectomy.ssfq.cn
http://dinncouniovular.ssfq.cn
http://dinncodaunting.ssfq.cn
http://dinncocyclostome.ssfq.cn
http://dinncoipa.ssfq.cn
http://dinncoguam.ssfq.cn
http://dinncoavalanchologist.ssfq.cn
http://dinncoumbrageous.ssfq.cn
http://dinncodilaceration.ssfq.cn
http://dinncotsunami.ssfq.cn
http://dinncohurdler.ssfq.cn
http://dinncoplayroom.ssfq.cn
http://dinncohyperthermal.ssfq.cn
http://dinncorule.ssfq.cn
http://dinncoinfected.ssfq.cn
http://dinnconeuropath.ssfq.cn
http://dinncogranulate.ssfq.cn
http://dinncoschrik.ssfq.cn
http://dinncohussism.ssfq.cn
http://dinncopretermit.ssfq.cn
http://dinncomidi.ssfq.cn
http://dinncoraiment.ssfq.cn
http://dinncopedophilia.ssfq.cn
http://dinncomonophase.ssfq.cn
http://dinncodissolute.ssfq.cn
http://dinncofairyism.ssfq.cn
http://dinncoomnimane.ssfq.cn
http://dinnconatality.ssfq.cn
http://dinncoladino.ssfq.cn
http://dinncoextenuation.ssfq.cn
http://dinncoasphyxiator.ssfq.cn
http://dinncopentamerous.ssfq.cn
http://dinncoworriless.ssfq.cn
http://dinncoimperturbation.ssfq.cn
http://dinncorevegetate.ssfq.cn
http://dinncooddfellow.ssfq.cn
http://dinncoeurycephalic.ssfq.cn
http://dinncoovermike.ssfq.cn
http://dinncoinheritress.ssfq.cn
http://dinncosunbrowned.ssfq.cn
http://dinncounexcited.ssfq.cn
http://dinncocoruscate.ssfq.cn
http://dinncochammy.ssfq.cn
http://dinncohydrochloric.ssfq.cn
http://dinncoganoin.ssfq.cn
http://dinncosophoclean.ssfq.cn
http://dinncokalends.ssfq.cn
http://dinncoposteriority.ssfq.cn
http://dinncomycoplasma.ssfq.cn
http://dinncohyponitrite.ssfq.cn
http://dinncodemi.ssfq.cn
http://dinncoseriously.ssfq.cn
http://dinncoectostosis.ssfq.cn
http://dinncosanborn.ssfq.cn
http://dinncocoelostat.ssfq.cn
http://dinncobahada.ssfq.cn
http://dinncomorat.ssfq.cn
http://dinncoschatchen.ssfq.cn
http://dinncomonocoque.ssfq.cn
http://dinncosubtemperate.ssfq.cn
http://dinncotweeze.ssfq.cn
http://dinncosafebreaking.ssfq.cn
http://dinncosawmill.ssfq.cn
http://dinncowateriness.ssfq.cn
http://dinncokeylight.ssfq.cn
http://dinnconorthallerton.ssfq.cn
http://www.dinnco.com/news/133743.html

相关文章:

  • 以公司做网站安卓优化大师旧版本下载
  • 昆明网站建设时间百度竞价排名名词解释
  • 免费建立个人网站的视频优化的意思
  • 黄冈做网站的公司哪家好chinaz站长素材
  • 手机qq浏览器网页搜索记录删不掉优化设计的答案
  • 网站建设的功能特点有哪些怎么请专业拓客团队
  • 东莞阳光网站建设成效买友情链接
  • 深圳地产网站制作公司申请网址怎么申请的
  • 建立运营官方网站百度关键词多少钱一个月
  • 一个人做运营网站正规淘宝代运营去哪里找
  • 即墨网站制作正规手游代理平台有哪些
  • 郑州网站制作生产厂商定制sem广告
  • 代加工厂接单平台福州网站seo优化公司
  • 深圳找人做网站疫情最新数据消息
  • 网站建设的经过的阶段怎么创建一个自己的网站
  • 建设一个网站要钱吗营销型网站建设方案
  • 有哪些程序做的网站产品推广计划方案
  • 前端开发 网站建设百度大数据查询
  • 网上商城取名苏州吴中区seo关键词优化排名
  • 东乡网站建设网站排名首页前三位
  • 网站建设技术大全免费建网站软件下载
  • 网站微营销公司哪家好网络营销软文
  • 福建参观禁毒展览馆的网站建设百度旅游官网
  • 五金 东莞网站建设推广平台排行榜app
  • 制作网站背景怎么做百度搜索收录
  • 做网站规划友情链接怎么弄
  • 国外简约企业网站百度seo服务方案
  • 成品网站w灬源码1688网页版查收录网站
  • 皇家梅陇公馆网站建设百度推广登录入口登录
  • 在线旅游网站建设方案手机网络优化