当前位置:网站首页>Ansible uses ordinary users to manage the controlled end
Ansible uses ordinary users to manage the controlled end
2022-06-23 06:01:00 【Foxconn quality inspector zhangquandan】
The scene that :ansible Use oldxu Common users uniformly manage all controlled nodes
1: First control end , Charged end , All need to have oldxu user , I won't make a demonstration at the accused end
[[email protected] ~]# echo "123" | passwd --stdin oldxu
Changing password for user oldxu.
passwd: all authentication tokens updated successfully.2: Connect the control end oldxu The user's public key is pushed to the controlled end oldxu Below the user , So that ordinary users can log in without secret
[rootemanager ~]# su- oldxu
[oldxuemanager ~]ssh-keygen-t rsa -N "" -f ~/.ssh/id_rsa
[oldxuamanager ~]ssh-copy-id -i ~/.ssh/id.pub [email protected]3. All hosts have oldxu Users must add sudo jurisdiction .
[[email protected]~]# visudo
root ALL=(ALL) ALL
oldxu ALL=(ALL) NOPASSWD:ALL
Check if the grammar is correct
[[email protected] ~]# visudo -c
/etc/sudoers: parsed OK4. Modify control end /etc/ansible/ansible.cfg Master profile , Configure user authorization
[privilege_escalation]
become=True
become_method=sudo
become_user=root
become_ask_pass=FalseAll the above steps can rely on ansible To do ,root No secret , have access to ansible To add users to all controlled terminals , Set a password for it , Then put the public key of the user at the control end under the specific user at the controlled end , That's it .
Finally, use this ordinary user to test
[[email protected] ~]$ ansible --version
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
[[email protected] ~]$ ansible all -m ping -i /etc/ansible/hosts边栏推荐
- The performance of nonstandard sprintf code in different platforms
- Pyinstaller 打包pyttsx3 出错
- Arctime makes Chinese and English subtitle video
- ssm项目搭建
- Basic calculator II for leetcode topic analysis
- PAT 乙等 1021 个位数统计
- jvm-05.垃圾回收
- Pat class B 1010 C language
- ant使用总结(三):批量打包apk
- The difference between SaaS software and traditional software delivery mode
猜你喜欢

Opportunities and challenges of digital collections from the perspective of technology development team

ant使用总结(一):使用ant自动打包apk

Cloud native database is the future

Advanced Mathematics (Seventh Edition) Tongji University exercises 1-8 personal solutions

ssm项目搭建

Behind the hot digital collections, a strong technical team is needed to support the northern technical team

jvm-03. JVM memory model

【Cocos2d-x】截图分享功能

HierarchyViewer工具找不到 HierarchyViewer位置

ant使用总结(二):相关命令说明
随机推荐
Visual Studio调试技巧
阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求
Alibaba cloud ack one and ACK cloud native AI suite have been newly released to meet the needs of the end of the computing era
Centos7部署radius服务-freeradius-3.0.13-15.el7集成mysql
The difference between SaaS software and traditional software delivery mode
vant weapp日历组件性能优化 Calendar 日历添加min-date最小日期页面加载缓慢
APP SHA1获取程序 百度地图 高德地图获取SHA1值的简单程序
JS interview question - anti shake function
MDM data cleaning function development description
Wireshark TS | 视频 APP 无法播放问题
Use of visdom
Real MySQL interview question (23) -- pinduoduo ball game analysis
Pyinstaller 打包pyttsx3 出错
jvm-02. Guarantee of orderliness
数字藏品到底有什么魔力?目前有哪些靠谱的团队在开发
jvm-05.垃圾回收
[cocos2d-x] screenshot sharing function
ssm项目搭建
exe闪退的原因查找方法
The digital collection market has just begun