Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

User module of operation and maintenance automation artifact ansible

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

User module of operation and maintenance automation artifact ansible I. Overview

The user module manages users on remote hosts, such as creating users, modifying users, deleting users, and creating key peering operations for users.

Second, parameter introduction name: used to specify the user of the operation, a required item. Uid: the UID used to specify user, which is empty by default. _ non_unique:_ is used in conjunction with the uid parameter to allow you to change UID to a non-unique value. Group: the parameter is used to specify the user's primary group. The default value is empty, and if it is empty, the user group name created is the same as the user name. Groups: parameter is used to specify the user belonging group. You can specify the user belonging group when you create the user, or you can manage the existing user belonging group. Append: manage user belonging groups together with the groups parameter. Default is false. If append='yes', the user belonging group is added from the groups parameter. If append='no', the user belonging group is only set to the group in groups, and all other belonging groups are removed. State: the parameter is used to specify whether the user exists on the remote host. Optional values are present and absent, and the default value is present. Remove: the parameter is used when state=absent, which is equivalent to userdel-- remove Boolean type, and the default value is false. Force: the parameter is used when state=absent, which is equivalent to userdel-- force, Boolean type. The default value is false. Home: parameter is used to specify the user home directory. The value is path _ create_home:_. Create a home directory for the user when the user creates it or when the home directory does not exist. Boolean type. Default is true_move_home:_. If set to yes, use in conjunction with home=. Temporarily migrate a user's home directory to a specific directory comment: parameter is used to specify user comment information shell: parameter is used to specify user default shellsystem: parameter is used to specify whether the user is a system user expires: parameter is used to specify user expiration time, which is equivalent to column 8 in the settings / etc/shadow file passwd: parameter is used to specify the user password, but this password cannot be a clear text password Instead, it is a string encrypted with a plaintext password. By default, the _ password_lock:_ parameter is used to lock the specified user, Boolean type. By default, the optional values of the _ update_password:_ parameter are always and on_create, and the default is always.

When set to always, the user's password is updated when the value of the password parameter is inconsistent with the password string in / etc/shadow

When set to on_create, the user's password is not updated if the value of the password parameter is inconsistent with the password string in / etc/shadow, but if it is a newly created user, the user's password is updated even if this parameter is on_create. The _ generate_ssh_key:_ parameter is used to specify whether to generate a ssh key pair, a Boolean type, which defaults to false. When set to yes, a ssh key pair is generated for the user, and the id_rsa private key and id_rsa.pub public key are generated by default in the ~ / .ssh directory. If the key with the same name already exists, no action is taken. _ sssh_key_bits:_ when generate_ssh_key=yes, specifies the number of ssh key encrypted bits generated. _ ssh_key_file:_ when generate_ssh_key=yes, use this parameter to specify the path and name of the ssh private key, which will generate the corresponding public key starting with the private key name and ending with .pub under the same path. _ ssh_key_comment:_ when generate_ssh_key=yes, when creating a certificate, use this parameter to set the annotation information in the public key. If the key with the same name already exists, nothing is done. When this parameter is not specified, the default comment information is "ansible-generated on\ $hostname". _ ssh_key_passphrase:_ when generate_ssh_key=yes, use this parameter to set the private key password when creating the certificate. If the key with the same name already exists, nothing is done. _ ssh_key_type:_ when generate_ssh_key=yes, use this parameter to specify the type of key pair when creating the certificate. The default value is rsa, and nothing is done if the key of the same name already exists. Third, detailed explanation of the parameters

The following English document is partly from ansible-doc, and the parameter is modified by "=" or "-"

OPTIONS (= is mandatory): starting with the = sign is the parameter that must be given

3.1 name

Name: the user used to specify the operation, required

= name Name of the user to create, remove or modify. (Aliases: user) type: str3.1.1 example

Use ansible to add test users on note1 nodes

[root@note0 ~] # ansible note1-m user-a "name=test" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1000, "home": "/ home/test", "name": "test" "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1000} [root@note0 ~] #

Verify that the user has been added successfully, and view the / etc/passwd file under the note1 node

[root@note1] # tail-1 / etc/passwdtest:x:1000:1000::/home/test:/bin/bash3.2 uid

Uid: the UID used to specify user. Default is empty.

-uid Optionally sets the `UID' of the user. [Default: (null)] type: int3.2.1 example

Use ansible to add testuid users on note1 nodes

[root@note0 ~] # ansible note1-m user-a "name=testuid uid=2000" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 2000, "home": "/ home/testuid", "name": "testuid" "shell": "/ bin/bash", "state": "present", "system": false, "uid": 2000} [root@note0 ~] #

Verify that the user has been added successfully, and view the / etc/passwd file under the note1 node

[root@note1] # tail-1 / etc/passwdtestuid:x:2000:2000::/home/testuid:/bin/bash3.3 state

State: the parameter is used to specify whether the user exists on the remote host.

Available values include present and absent:

The default value is present, which means that the user exists, which is equivalent to creating a user on a remote host

When set to absent, the user does not exist, which is equivalent to deleting the user from the remote host.

-state Whether the account should exist or not, taking action if the state is different from what is stated. (Choices: absent, present) [Default: present] type: str3.3.1 example

Delete a test user on a note1 node using ansible

[root@note0 ~] # ansible note1-m user-a "name=test state=absent" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "force": false, "name": "test", "remove": false, "state": "absent"} [root@note0 ~] #

Verify whether the user has been deleted successfully, and check to see if there is a test user under the note1 node

[root@note1 ~] # id testid: test: no such user3.4 remove

Remove: the parameter is used when state=absent, which is equivalent to userdel-- remove Boolean type, and the default value is false.

-remove This only affects `state=absent', it attempts to remove directories associated with the user. The behavior is the same as `userdel-- remove', check the man page for details and support. [Default: False] type: bool3.4.1 example 1

Now that we have deleted the test user on the note1 node using ansible in example 3.3.1, let's see if the test user home directory exists.

[root@note1] # cd / home# View home directory [root@note1 home] # ll total usage 0drwx-2 1000 1000 59 July 9 16:41 testdrwx- 2 testuid testuid 59 July 9 17:01 testuid [root@note1 home] #

We can see that the user home directory deleted through state=absent still exists, so let's demonstrate the complete deletion of a user.

3.4.2 example 2

Delete a testuid user on a note1 node using ansible

[root@note0 ~] # ansible note1-m user-a "name=testuid state=absent remove=yes" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "force": false, "name": "testuid", "remove": true, "state": "absent"} [root@note0 ~] #

Let's verify that the user and the home directory are deleted completely.

# check whether testuid users exist [root@note1 home] # id testuidid: testuid: no such user# View home Directory [root@note1 home] # ll Total usage 0drwx-2 1000 1000 59 July 9 16:41 test [root@note1 home] # 1000 group

Group: the parameter is used to specify the user's primary group. The default value is empty, and the user group name created is the same as the user name.

-group Optionally sets the user's primary group (takes a group name). [Default: (null)] type: str3.5.1 example

Use ansible to create a test user on the note1 node and specify the primary group as testgrp

# first create a testgrp group using ansible [root@note0] # ansible note1-m group-a "name=testgrp state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "gid": 1000, "name": "testgrp", "state": "present" "system": false} # create test users using ansible [root@note0 ~] # ansible note1-m user-a "name=test group=testgrp state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1000 "home": "/ home/test", "name": "test", "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1000} [root@note0 ~] #

Verify that the user has created successfully

[root@note1 home] # id testuid=1000 (test) gid=1000 (testgrp) group = 1000 (testgrp) 3.6groups, append

Groups: parameter is used to specify the user belonging group. You can specify the user belonging group when you create the user, or you can manage the existing user belonging group.

Groups is a list type, and multiple parameters are separated by commas. For example, the default value of groups='grp,mygrp'; is empty, or you can set empty strings groups='',groups= `null` and groups= `~` to remove users from other affiliated groups.

Append: use with the groups parameter to manage user belonging groups. Boolean type, default is false, if append='yes', the user's group is increased from the groups parameter; if append='no', the user group is only set to the group in groups, and all other groups are removed.

-groups List of groups user will be added to. When set to an empty string `', `null', or `~', the user is removed from all groups except the primary group. (`~ 'means `null' in YAML) Before Ansible 2.3, the only input format allowed was a comma separated string. [Default: (null)] type: list- append If `yes', add the user to the groups specified in `groups'. If `no', user will only be added to the groups specified in `groups', removing them from all other groups. [Default: False] type: bool3.6.1 example 1-specify a group when creating a user

First use ansible to create a mygrp1,mygrp2,mygrp3 test group on the note1 node

# first create a test group using [root@note0] # ansible note1-m group-a "name=mygrp1 gid=2001 state=present" [root@note0 ~] # ansible note1-m group-a "name=mygrp2 gid=2002 state=present" [root@note0 ~] # ansible note1-m group-a "name=mygrp3 gid=2003 state=present" # Test Group successfully created [root@note1 home] # cat / etc/groupmygrp1:x:2001:mygrp2:x:2002:mygrp3:x:2003:

Create a user testuser and specify the subordinate group as mygrp1 mygrp2

[root@note0 ~] # ansible note1-m user-a "name=testuser groups=mygrp1,mygrp2 state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1001, "groups": "mygrp1,mygrp2" "home": "/ home/testuser", "name": "testuser", "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1001} [root@note0 ~] #

Verify that the subordinate group of user testuser is mygrp1,mygrp2

[root@note1 home] # id testuseruid=1001 (testuser) gid=1001 (testuser) group = 1001 (testuser), 2001 (mygrp1), 2002 (mygrp2) 3.6.2 example 2-user added group has been created

Change the subordinate group of testuser to mygrp1,mygrp2,mygrp3

3.6.2.1 do not use append Use groups to specify all groups belonging to the user [root@note0 ~] # ansible note1-m user-a "name=testuser groups='mygrp1,mygrp2,mygrp3' state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "append": false, "changed": true, "comment": "," group ": 1001 "groups": "mygrp1,mygrp2,mygrp3", "home": "/ home/testuser", "move_home": false, "name": "testuser", "shell": "/ bin/bash", "state": "present", "uid": 1001} [root@note0 ~] #

Verify whether the affiliated group of user testuser is mygrp1,mygrp2,mygrp3

[root@note1 home] # id testuseruid=1001 (testuser) gid=1001 (testuser) group = 1001 (testuser), 2001 (mygrp1), 2002 (mygrp2), 2003 (mygrp3) 3.6.2.2 use the append attribute

First restore the testuser user group to mygrp1,mygrp2

Add genus and group mygrp3

# when using append=yes, only the generic groups to be added can be entered into the groups parameter. [root@note0 ~] # ansible note1-m user-a "name=testuser groups='mygrp3' append=yes state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "append": true, "changed": true, "comment": "", "group": 1001, "groups": "mygrp3" "home": "/ home/testuser", "move_home": false, "name": "testuser", "shell": "/ bin/bash", "state": "present", "uid": 1001} [root@note0 ~] #

Verify whether the affiliated group of user testuser is mygrp1,mygrp2,mygrp3

[root@note1 home] # id testuseruid=1001 (testuser) gid=1001 (testuser) group = 1001 (testuser), 2001 (mygrp1), 2002 (mygrp2), 2003 (mygrp3) 3.6.3 example 3-created user removal group

Change the subordinate group of testuser to mygrp1

3.6.3.1 do not use append Use groups to specify all groups belonging to the user [root@note0 ~] # ansible note1-m user-a "name=testuser groups='mygrp1' state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "append": false, "changed": true, "comment": "," group ": 1001," groups ":" mygrp1 " "home": "/ home/testuser", "move_home": false, "name": "testuser", "shell": "/ bin/bash", "state": "present", "uid": 1001} [root@note0 ~] #

Verify whether the affiliated group of user testuser is mygrp1

[root@note1 home] # id testuseruid=1001 (testuser) gid=1001 (testuser) group = 1001 (testuser), 2001 (mygrp1) 3.6.3.2 use append attribute

First restore the testuser user group to mygrp1,mygrp2,mygrp3

Then change the user testuser belonging group to mygrp3

# when using append=no The user's subordinate group is only set to the group [root@note0 ~] # ansible note1-m user-a "name=testuser groups='mygrp1' append='no' state=present" 176.16.128.1 in the groups parameter | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "append": false, "changed": true, "comment": "," group ": 1001 "groups": "mygrp1", "home": "/ home/testuser", "move_home": false, "name": "testuser", "shell": "/ bin/bash", "state": "present", "uid": 1001} [root@note0 ~] #

Verify whether the affiliated group of user testuser is mygrp1

[root@note1 home] # id testuseruid=1001 (testuser) gid=1001 (testuser) group = 1001 (testuser), 2001 (mygrp1) 3.7passwd

Passwd: parameter is used to specify the user's password, but this password cannot be a plaintext password, but a string encrypted by the plaintext password, which is equivalent to the password field in the / etc/shadow file. It is a string after hashing the plaintext password. You can use the command to generate an encrypted string corresponding to the plaintext password.

-password Optionally set the user's password to this crypted value. On macOS systems, this value has to be cleartext. Beware of security issues. To create a disabled account on Linux systems, set this to''!'' Or ``*'. See https://docs.ansible.com/ansible/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module for details on various ways to generate these password values. [Default: (null)] type: str

To generate the password for the md5 algorithm, use openssl.

Openssl passwd-1 '123456'openssl passwd-1-salt' abcdefg' '123456'

However, openssl passwd does not support generating passwords for sha-256 and sha-512 algorithms. Generate the sha-512 algorithm using the python command

Python-c 'import crypt,getpass;pw= "123456"; print (crypt.crypt (pw))'

Now it's much more convenient to assign the result directly to the variable.

[root@note0 ~] # ajar $(python-c 'import crypt,getpass;pw= "123456"; print (crypt.crypt (pw))') [root@note0 ~] # echo $axi6 $uKhnBg5A4/jC8KaU$scXof3ZwtYWl/6ckD4GFOpsQa8eDu6RDbHdlFcRLd/2cDv5xYe8hzw5ekYCV5L2gLBBSfZ.Uc166nz6TLchlp.

For example, ansible creates a user and specifies a password:

[root@note0 ~] # update_password=always' $(python-c 'import crypt,getpass;pw= "123456"; print (crypt.crypt (pw))') [root@note0 ~] # ansible note1-m user-a 'name=testpass password= "$a" update_password=always' [WARNING]: The input password appears not to have been hashed. The 'password' argument must be encrypted for this module to work properly.176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1005, "home": "/ home/testpass", "name": "testpass" "password": "NOT_LOGGING_PASSWORD", "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1005} [root@note0 ~] #

Login authentication

[root@note0 ~] # ssh testpass@note1testpass@note1's password: Last login: Thu Jul 11 00:12:57 2019 from note0 [testpass@note1 ~] $who am itestpass pts/1 2019-07-11 00:13 (note0) [testpass@note1 ~] $3.8expires

Expires: parameter is used to specify the expiration time of the user, which is equivalent to column 8 in the / etc/shadow file. For example, if you want to set the expiration date of the user to July 10, 2019, you first need to obtain the unix timestamp of July 10, 2019. The timestamp obtained by using the command date-d 20190710 +% s is 1562688000, so when setting expires=1562688000, the expiration time of the user is 00:00 on July 10, 2019. After the setting is successful, check the / etc/shadow file of the remote host, and the value of column 8 corresponding to the user will become 18086 (indicating the number of days from January 1, 1970 to July 10, 2019, the value of unix timestamp will be automatically converted to days, we do not have to convert manually). In the current ansible version, this parameter is supported in GNU/Linux, FreeBSD, and and DragonFlyBSD systems.

3.8.1 exampl

Set a user testexprie with an expiration time of 20190710

[root@note0 ~] # ansible note1-m user-a "name=testexpire expires=1562688000 comment='expires date is 20190710' state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "expires date is 20190710", "create_home": true, "group": 1003, "home": "/ home/testexpire" "name": "testexpire", "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1003} [root@note0 ~] #

Authenticate testexprie users on note1

[root@note1 home] # cat / etc/shadowtestexpire:!!:18086:0:99999:7::18086:

Login failed, indicating that the account has expired

[root@note0 ~] # ssh testexpire@note1testexpire@note1's password: Your account has expired; please contact your system administratorConnection closed by 176.16.128.13.9 home

Home: parameter is used to specify the user home directory, and the value is the path

-home Optionally set the user's home directory. [Default: (null)] type: path- create_home Unless set to `no', a home directory will be made for the user when the account is created or if the home directory does not exist. Changed from `createhome' to `create_home' in Ansible 2.5. (Aliases: createhome) [Default: True] type: bool- move_home If set to `yes' when used with `home:', attempt to move the user's old home directory to the specified directory if it isn't there already and the old home exists. [Default: False] type: bool3.9.1 example [root@note0 ~] # ansible note1-m user-a "name=testhome home=/home/testdir state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1004 "home": "/ home/testdir", "name": "testhome", "shell": "/ bin/bash", "state": "present", "system": false, "uid": 1004} [root@note0 ~] #

Verify the home directory of the testhome user

# first log in to the note1 node, and su to the testhome user [root@note1 ~] # su-testhome# cd to the home directory [testhome@note1 ~] $cd ~ # execute pwd [testhome@note1 ~] $pwd/home/testdir [testhome@note1 ~] $3.10 move_home

If set to yes, _ move_home:_ is used in conjunction with home= to temporarily migrate the user's home directory to a specific directory

-move_home If set to `yes' when used with `home:', attempt to move the user's old home directory to the specified directory if it isn't there already and the old home exists. [Default: False] type: bool3.10.1 example

First create the testmove user, and then create the test_move_home.txt file under the testmove user home directory

# create a testmove user. [root@note0 ~] # ansible note1-m user-a "name=testmove state=present" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1006, "home": "/ home/testmove", "name": "testmove" "shell": "/ bin/bash", "state": "present", "system": false "uid": 1006} # create a test_move_home.txt file [root@note0 ~] # ansible note1-m file-a "path=/home/testmove/test_move_home.txt state=touch" 176.16.128.1 in the testmove user home directory using ansible's file module | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true "dest": "/ home/testmove/test_move_home.txt", "gid": 0, "group": "root", "mode": "0644", "owner": "root", "size": 0, "state": "file", "uid": 0} # on note1 nodes Check to see if test_move_ home.txt [root @ note1 ~] # cd / home/testmove [root@note1 testmove] # ll total usage 0kuwkuhashi-1 root root 0 July 11 06:22 test_move_ home.txt [root @ note1 testmove] # exists under / home/testmove

Use the move_home parameter of ansible to migrate the user home directory

# migrate the home directory of testmove users to / tmp/testmove_ new[ root @ note0 ~] # ansible note1-m user-a "user=testmove move_home=yes home=/tmp/testmove_new/" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "append": false, "changed": true, "comment": "," group ": 1006 "home": "/ tmp/testmove_new/", "move_home": true, "name": "testmove", "shell": "/ bin/bash", "state": "present", "uid": 1006} [root@note0 ~] #

Verify that the test_move_home.txt file exists in the new home directory of the migration

[root@note1 testmove] # cd / tmp/testmove_new/ [root @ note1 testmove_new] # Total amount of ll 0 root 11 July 06:22 test_move_ home.txt [root @ note1 testmove_new] # 3.11 generate_ssh_key

The _ generate_ssh_key:_ parameter is used to specify whether to generate a ssh key pair, a Boolean type, which defaults to false. When set to yes, a ssh key pair is generated for the user, and the id_rsa private key and id_rsa.pub public key are generated by default in the ~ / .ssh directory. If the key with the same name already exists, no action is taken.

-generate_ssh_key Whether to generate a SSH key for the user in question. This will * not* overwrite an existing SSH key unless used with `force=yes'. [Default: False] type: bool version_added: 0.93.11.1 example

Use ansible to create testssh users and generate ssh_key.

[root@note0 ~] # ansible note1-m user-a "name=testssh state=present generate_ssh_key=yes" 176.16.128.1 | CHANGED = > {"ansible_facts": {"discovered_interpreter_python": "/ usr/bin/python"}, "changed": true, "comment": "", "create_home": true, "group": 1007, "home": "/ home/testssh" "name": "testssh", "shell": "/ bin/bash", "ssh_fingerprint": "2048 07:18:48:ea:f1:dc:95:22:75:fc:b5:5e:80:25:a7:1f ansible-generated on note1 (RSA)", "ssh_key_file": "/ home/testssh/.ssh/id_rsa" "ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIrQCOP11FK/s50vpOm/z+hXEmet+oEdWqGbyQD0JdN0AJrS/MzHZF3v+sjMf4SoDL7PafPYnFY4iVEtNOuBK8uvQgziVXVRxPs7h9Yy+ZdFw8qFjeiC74pKl+0Mqq49I9TD1GMbOQRd0K7nTycymCAX0MW5lQz7q44f3qa4+4y8C63xxi/4H9x3lJ+JsjDDIzKo4i69CnqU3Bn+0HzfxYi9j63HtcdLF8OwVfyF73lK6xd+vK68AaxRfPIOEj4KJXU3iMdiM5zVvMZgjEKyaGKPJD/uQl35MV2oazmFHTHWrKgA5AXwJEMKJYJzF6a8Z6SrmSnvxp6TpnMmbXAjev ansible-generated on note1", "state": "present", "system": false, "uid": 1007} [root@note0 ~] #

Verify the ssh_key file under the note1 node

[root@note1 ~] # cd / home/testssh/.ssh [root@note1 .ssh] # ll Total usage 8murrw1 testssh testssh 1679 July 11 06:39 id_rsa-rw-r--r-- 1 testssh testssh 408 July 11 06:39 id_ rsa.pub[ root @ note1 .ssh] # cat id_rsa.pubssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIrQCOP11FK/s50vpOm/z+hXEmet+oEdWqGbyQD0JdN0AJrS/MzHZF3v+sjMf4SoDL7PafPYnFY4iVEtNOuBK8uvQgziVXVRxPs7h9Yy+ZdFw8qFjeiC74pKl+0Mqq49I9TD1GMbOQRd0K7nTycymCAX0MW5lQz7q44f3qa4+4y8C63xxi/4H9x3lJ+JsjDDIzKo4i69CnqU3Bn+0HzfxYi9j63HtcdLF8OwVfyF73lK6xd+vK68AaxRfPIOEj4KJXU3iMdiM5zVvMZgjEKyaGKPJD/uQl35MV2oazmFHTHWrKgA5AXwJEMKJYJzF6a8Z6SrmSnvxp6TpnMmbXAjev ansible-generated on note1 [root@note1 .ssh] #

This is the end of the common parameters of ansible's user module, so I won't go into too much detail. Welcome to guide and communicate.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report