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

FreeIPA信息管理与ssh远程登录

时间:2016-10-12 23:14:06      阅读:296      评论:0      收藏:0      [点我收藏+]

标签:配置文件   服务器   server   客户机   enable   

1.安装ntp并配置ntp服务器来完成时间同步

   安装: yum -y install ntp

   配置:vim /etc/ntp.conf

      将文件的21-24行注释掉,并在25行添加server asia.pool.ntp.org

   启动并设置开机自启动:systemctl start ntpd

                 systemctl enable ntpd   

    查看当前时间;  date(与网络时间相同即可)

在客户机端同样安装ntp服务器并配置:

   安装yum -y install ntp 

   修改配置文件vim /etc/ntp.conf


   启动并设置开机自启(同上) 

2.FreeIPA服务器

2.1 安装并配置FreeIPA

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

   vim /etc/hosts

   添加自己的IP:192.168.46.134  workstation.example.com

   ipa-server-install --setup-dns (根据提示设置目录管理密码和IPA管理密码) 

   kinit admin 

   klist    #确认

   (若防火墙处于开启状态放行FreeIPA服务) 

  添加用户ipa user-add ruiyung --first=Yun --last=Rui --password

  在FreeIPA上为FreeIPA添加DNS

   ipa dnsrecord-add example.com server1 -a-rec 192.168.46.102(server2 和database同样)

在客户端安装客户端工具并修改DNS:yum -y install ipa-client

            nmcli c modify eno16777736 ipv4.dns 192.168.46.134

 若出现问题可将网卡配置文件中的系统名修改为eno16777736与DNS改为192.168.46.134,重启网络(每次在改动过配置文件后都要重启服务)

ipa-client-install(按照提示操作)

authconfig--enablehomedir --update

在C盘-windows-system32-drivers-etc-hosts添加DNS解析然后在浏览器查看

3.Key认证

创建密钥:ssh kegen

切换到.ssh下

ssh-copy-id id_rsa

ssh-copy-id -i database.example.com将密钥拷贝到本地的ssh目录中

在workstation远程登录:ssh root@server1.example.com

若将ssh配置文件中第49行的Permitrootlogin yes 改为no即不允许root用户登录

            79行的passwordauthentication yes 改为no即不允许用密码方式登录         


FreeIPA信息管理与ssh远程登录

标签:配置文件   服务器   server   客户机   enable   

原文地址:http://12156971.blog.51cto.com/12146971/1861244

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