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

ntp+freeipa+ssh

时间:2016-10-12 23:16:55      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:database   互联网   server1   

1.ntp时间同步协议

    ● workstation与互联网时间同步

    ● server1 server2 database 与workstation同步

  在所有机器上安装ntp

     #yum -y install ntp

  workstation机器配置

     #vim /etc/ntp.conf

           restrict 192.168.83.0 mask 255.255.255.0 nomodify notrap(允许特定网段同步时间)

          #server 0.centos.pool.ntp.org iburst

          #server 1.centos.pool.ntp.org iburst

          #server 2.centos.pool.ntp.org iburst

          #server 3.centos.pool.ntp.org iburst

           server asia.pool.ntp.org iburst

      重启ntpd服务

       #ntpq -p

       #timedatectl

   客户端(server1 server2 database)

       #vim /etc/ntp.conf

            #server 0.centos.pool.ntp.org iburst

            #server 1.centos.pool.ntp.org iburst

            #server 2.centos.pool.ntp.org iburst

            #server 3.centos.pool.ntp.org iburst

             server 192.168.83.100 iburst

        重启ntpd服务

         #ntpq -p

         #timedatectl

2.FreeIPA服务( FreeIPA是一个集成的安全信息管理解决方案。它整合了389-ds(LDAP)、   Kerberos、NTP、bind、apache、tomcat核心软件包,形成一个以389-ds(LDAP)为数据存   储后端,Kerberos为验证前端,bind为主机识别,并且具有统一的命令行管理工具及   apache+tomcat提供的web管理界面的集成信息管理系统。

    workstation端

         #yum -y install ipa-server ipa-server-dns bind bind-dyndb-ldap

         #vim /etc/hosts

            192.168.83.100 workstation.example.com(域名解析)

         #ipa-server-install --setup-dns

         #kinit admin

         #ipa user-add ruiyung --first=Yun --last=Rui --password

         #ipa dnsrecord-add example.com server1 --a-rec 192.168.83.201

         #ipa dnsrecord-add example.com server2 --a-rec 192.168.83.202

         #ipa dnsrecord-add example.com database --a-rec 192.168.83.203

    server1 server2 database端

         #yum -y install ipa-client

         #nmcli c modify eno16777736 ipv4.dns 192.168.83.100(更改客户端的DNS为服务端)

         #ipa-client-install

         #authconfig --enablemkhomedir --update 

    进到主机中更改ruiyung的密码,显示登录成功

    c---windows—system32---driver----etc_hosts打开192.168.96.100  

    添加workstation.example.com

    选项------高级-------证书管理器-----服务器

    进入图形化界面

3. ssh认证服务(SSH为SecureShell的缩写,由IETF的网络工作小组(NetworkWorkingGroup)所制定;SSH为建立在应用层传输层基础上的安全协议。SSH是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议。)

          workstation端

                #ssh-keygen

                #ssh-copy-id -i server1.example.com

                #ssh-copy-id -i server2.example.com

                #ssh-copy-id -i database.example.com

                #ssh root@server1.example.com  远程连接

                #vim reboor.sh(关机脚本)

                        #!/bin/bash

        echo "--------------"

        echo "server1 server2 database"

        echo -n "please input whichmachine you want to reboot:"

        read mm

        ssh root@${mm}.example.com "reboot"

     #sh reboot.sh

  查看server1 server2 database是否关机

     server1 server2 database 端

        #vim /etc/ssh/sshd_config

            PermitRootLogin yes    yes-->no  (root用户不能登陆)

                        PasswordAuthentication yes   yes-->no (不用密码认证)

            重启sshd服务

      

  

ntp+freeipa+ssh

标签:database   互联网   server1   

原文地址:http://12156691.blog.51cto.com/12146691/1861236

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