设为首页 收藏本站
查看: 1022|回复: 0

[经验分享] 这篇文章主要介绍了在CentOS上安装phpMyAdmin的教程,phpMyAdmin...

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-11-25 09:10:11 | 显示全部楼层 |阅读模式
第一步 准备升级包

        openssh相关包
        openssh-7.3p1.tar.gz
        openssl-1.0.2j.tar.gz
        zlib-1.2.8.tar.gz

        telnet相关包
        telnet-0.17-47.el6_3.1.x86_64.rpm
        telnet-server-0.17-47.el6_3.1.x86_64.rpm
        xinetd-2.3.14-39.el6_4.x86_64.rpm
        远程操作选择telnet;

第二步 安装工具包

        telnet安装

[iyunv@localhost telnet]# rpm -ivh xinetd-2.3.14-39.el6_4.x86_64.rpm
warning: xinetd-2.3.14-39.el6_4.x86_64.rpm: Header V3 RSA/SHA256 Signature, key I
D fd431d51: NOKEYPreparing...                ########################################### [100%]
   1:xinetd                 ########################################### [100%]
[iyunv@localhost telnet]# rpm -ivh telnet-0.17-47.el6_3.1.x86_64.rpm
warning: telnet-0.17-47.el6_3.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key I
D fd431d51: NOKEYPreparing...                ########################################### [100%]
   1:telnet                 ########################################### [100%]
[iyunv@localhost telnet]# rpm -ivh telnet-server-0.17-47.el6_3.1.x86_64.rpm
warning: telnet-server-0.17-47.el6_3.1.x86_64.rpm: Header V3 RSA/SHA256 Signature
, key ID fd431d51: NOKEYPreparing...                ########################################### [100%]
   1:telnet-server          ########################################### [100%]##设置telnet远程登录[iyunv@localhost telnet]# vi /etc/xinetd.d/telnet# default: on# description: The telnet server serves telnet sessions; it uses \#   unencrypted username/password pairs for authentication.service telnet
{    flags       = REUSE    socket_type = stream            wait        = no    user        = root    server      = /usr/sbin/in.telnetd    log_on_failure  += USERID    disable     = no}
[iyunv@localhost telnet]# service xinetd restart##添加telnet远程登录用户,(远程root不登录)[iyunv@localhost telnet]# useradd test
[iyunv@localhost telnet]# passwd test

第三步 编译安装

        删除已安装包

[iyunv@localhost ssh]# rpm -qa|grep openssh
openssh-askpass-5.3p1-84.1.el6.x86_64
openssh-clients-5.3p1-84.1.el6.x86_64
openssh-5.3p1-84.1.el6.x86_64
openssh-server-5.3p1-84.1.el6.x86_64
[iyunv@localhost ssh]# rpm -e openssh-askpass-5.3p1-84.1.el6.x86_64
[iyunv@localhost ssh]# rpm -e openssh-clients-5.3p1-84.1.el6.x86_64 --nodeps
[iyunv@localhost ssh]# rpm -e openssh-5.3p1-84.1.el6.x86_64 --nodeps
[iyunv@localhost ssh]# rpm -e openssh-server-5.3p1-84.1.el6.x86_64

        编译安装

[iyunv@localhost ssh]# tar -zxvf zlib-1.2.8.tar.gz
[iyunv@localhost ssh]# cd zlib-1.2.8
[iyunv@localhost zlib-1.2.8]# ./configure
[iyunv@localhost zlib-1.2.8]# make && make install
[iyunv@localhost zlib-1.2.8]# cd ..
[iyunv@localhost ssh]# tar -zxvf openssl-1.0.2j.tar.gz
[iyunv@localhost ssh]# cd openssl-1.0.2j
[iyunv@localhost openssl-1.0.2j]# ./config --prefix=/usr/ --shared
[iyunv@localhost openssl-1.0.2j]# make
[iyunv@localhost openssl-1.0.2j]# make test
[iyunv@localhost openssl-1.0.2j]# make install
[iyunv@localhost openssl-1.0.2j]# cd ..
[iyunv@localhost ssh]# tar -zxvf openssh-7.3p1.tar.gz
[iyunv@localhost ssh]# cd openssh-7.3p1
[iyunv@localhost openssh-7.3p1]# mv /etc/ssh /etc/ssh_bak
[iyunv@localhost openssh-7.3p1]# ./configure --prefix=/usr --sysconfdir=/etc/ssh  --with-zlib   --with-md5-passwords
[iyunv@localhost openssh-7.3p1]# make
[iyunv@localhost openssh-7.3p1]# make install
[iyunv@localhost openssh-7.3p1]# cd contrib/redhat#复制启动脚本[iyunv@localhost redhat]# cp sshd.init /etc/init.d/sshd
[iyunv@localhost redhat]# cd /etc/init.d/
[iyunv@localhost redhat]# chmod +x /etc/init.d/sshd
[iyunv@localhost init.d]# chkconfig sshd
[iyunv@localhost init.d]# chkconfig --add sshd
[iyunv@localhost redhat]# cd ..#生成登录密钥[iyunv@localhost openssh-7.3p1]# pwd
/mywork/soft/ssh/openssh-7.3p1
[iyunv@localhost openssh-7.3p1]# ./ssh-keygen
[iyunv@localhost openssh-7.3p1]# cd /root/.ssh/
[iyunv@localhost .ssh]# ls
id_rsa  id_rsa.pub
[iyunv@localhost .ssh]# cat id_rsa.pub  >> authorized_keys
[iyunv@localhost .ssh]# service sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[iyunv@localhost ~]# ssh -V
OpenSSH_7.3p1, OpenSSL 1.0.2j  26 Sep 2016

第四步 所遇问题

        安装完毕后root用户无法ssh登录
        由于新版本的ssh禁用了root用户登录,需将允许登录开启

    [iyunv@localhost ssh]# pwd
    /etc/ssh#设置允许root用户远程登录[iyunv@localhost ssh]# cat /etc/ssh/sshd_config
    # Authentication:...#LoginGraceTime 2mPermitRootLogin yes

        启动报错
        报错效果如下:

    [iyunv@ssh ~]# service sshd restart   
    Stopping sshd:                                             [  OK  ]
    /sbin/restorecon:  lstat(/etc/ssh/ssh_host_key.pub) failed:  No such file or dire
    ctoryStarting sshd:                                             [  OK  ]                                           [确定]

    只要touch该文件即可规避

    [iyunv@ssh ~]# touch /etc/ssh/ssh_host_ecdsa_key.pub

    再重启一下ssh服务,就没有那个报错了

    [iyunv@localhost .ssh]# service sshd restart
    Stopping sshd:                                             [  OK  ]
    Starting sshd:                                             [  OK  ]

        SecureCRT不能上传文件的解决办法

    #将 /etc/ssh/sshd_config 中的Subsystem      sftp    /usr/libexec/openssh/sftp-server
    #改为Subsystem       sftp    internal-sftp#重启sshd后,sftp正常工作了

        使用其他工具无法远程连接操作系统

解决方法:
=================================================================参考网上解决方法如下:
修改sshd的配置文件 /etc/ssh/sshd_config
在配置文件中添加:

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

导致此问题的原因是ssh升级后,为了安全,默认不再采用原来一些加密算法,我们手工添加进去即可。

(添加三行或者添加最后一行,重启服务都报错如下)
但重启服务报错如下:
[iyunv@db ~]# service sshd restart
Stopping sshd:[  OK  ]
Starting sshd:Unsupported KEX algorithm "ecdh-sha2-nistp521"
/etc/ssh/sshd_config line 137: Bad SSH2 KexAlgorithms 'diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org'.
[FAILED]
[iyunv@db ~]#

=================================================================

修改为如下:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org    (此行中去掉ecdh-sha2-nistp521)

        重启后登录不上SSH
        升级完ssh以后,服务器在重启之后用ssh登录不上,只有telnet上去重新启动一下ssh才行。
        解决办法 :

    vi /etc/selinux/config---SELINUX=disabled

    关闭SELINUX即可;




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-305278-1-1.html 上篇帖子: 在CentOS上yum安装phpMyAdmin的教程 下篇帖子: 故障-启动类故障排错记录- Read-only file system 文章
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表