GithubHelp home page GithubHelp logo

cussh's Introduction

cussh

自动批量创建用户和配置SSH无密码登陆 脚本主要完成的功能: 1,自动化批量建立用户 2,自动化批量双向配置SSH认证 3,测试通过Centos6.5,其他系统大同小异,如报错,可改部分代码

使用步骤:

1,配置集群的host文件,把所有机器的IP都写在hosts文件里,注意默认这几个文件解压在root根目录即可。

2,先在第一台root用户上执行 ssh-keygen -t rsa -P ''一路回车生成ssh文件

3,然后执行initroot.sh脚本,并传入root账号的用户名,密码,此脚本会首先检测系统是否安装过expect,如果没有 安装,则yum下载,如果安装过,则直接进行ssh文件拷贝,并执行公钥认证

4,执行cuser.sh脚本,并传入要建立用户的账号密码,就可以批量的在多个机器上建立用户了

5,然后拷贝root跟目下下的hosts文件和noroot.sh文件到上面建的用 户根目录下,并把权限改成用户权限 6,然后切入刚才建立的账户,同样执行第2个步骤生成ssh文件

7,最后执行noroot.sh文件,给刚才建的批量用户之间建立ssh双向无密码认证

8,至此完成,批量用户创建和SSH认证。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.