码迷,mamicode.com
首页 > 其他好文 > 详细

jump用户管理命令

时间:2019-08-07 19:08:02      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:用户管理   bin   touch   ash   其他   serve   管理命令   long   sudo   

ssh-keygen -t rsa -P ‘‘ -f ~/.ssh/id_rsa
手动拷贝id_rsa.pub的内容到其他机器

#跳板机新建user并拷贝公钥:

useradd leixiaolong   #install home Dir auto

cd /home/leixiaolong

mkdir .ssh

cd .ssh

touch authorized_keys

chmod 600 authorized_keys

chown -R leixiaolong: leixiaolong ../.ssh

 

#Jumpserver系统用户sudo -i权限其实是写在/etc/sudoers文件里

sudoedit /etc/sudoers

1/ 可以sudo的配置

feng.feng ALL=(ALL) NOPASSWD: /bin/whoami,/bin/su,/bin/bash,!/bin/tcsh,!/usr/bin/passwd,!/usr/bin/passwd root,!/bin/vim /etc/sudoers,!/usr/bin/vim /etc/sudoers,!/usr/sbin/visudo,!/usr/bin/sudo -i,!/bin/bi /etc/ssh/*,!/bin/chmod 777 /etc/*,!/bin/chmod 777 *,!/bin/chmod 777,!/bin/chmod -R 777 *,!/bin/rm /*,!/bin/rm /,!/bin/rm -rf /,!/bin/rm -rf /*,!/bin/rm /etc,!/bin/rm -r /etc,!/bin/rm -rf /etc,!/bin/rm /etc/*,!/bin/rm -r /etc/*,!/bin/rm -rf /etc/*,!/bin/rm /root,!/bin/rm -r /root,!/bin/rm -rf /root,!/bin/rm /root/*,!/bin/rm -r /root/*,!/bin/rm -rf /root/*,!/bin/rm /bin,!/bin/rm -r /bin,!/bin/rm -rf /bin,!/bin/rm /bin/*,!/bin/rm -r /bin/*,!/bin/rm -rf /bin/*

2/ 不可以sudo的配置

feng.feng  ALL=(ALL) NOPASSWD: /bin/whoami,!/bin/tcsh,!/usr/bin/passwd,!/usr/bin/passwd root,!/bin/vim ,!/usr/bin/vim /etc/sudoers,!/usr/sbin/visudo,!/usr/bin/sudo -i,!/bin/bi /etc/ssh/*,!/bin/chmod 777 /etc/*,!/bin/chmod 777 *,!/bin/chmod 777,!/bin/chmod -R 777 *,!/bin/rm /*,!/bin/rm /,!/bin/rm -rf /,!/bin/rm -rf /*,!/bin/rm /etc,!/bin/rm -r /etc,!/bin/rm -rf /etc,!/bin/rm /etc/*,!/bin/rm -r /etc/*,!/bin/rm -rf /etc/*,!/bin/rm /root,!/bin/rm -r /root,!/bin/rm -rf /root,!/bin/rm /root/*,!/bin/rm -r /root/*,!/bin/rm -rf /root/*,!/bin/rm /bin,!/bin/rm -r /bin,!/bin/rm -rf /bin,!/bin/rm /bin/*,!/bin/rm -r /bin/*,!/bin/rm -rf /bin/*

 

jump用户管理命令

标签:用户管理   bin   touch   ash   其他   serve   管理命令   long   sudo   

原文地址:https://www.cnblogs.com/hongfeng2019/p/11317035.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!