{"id":117427,"date":"2018-09-03T08:04:49","date_gmt":"2018-09-03T00:04:49","guid":{"rendered":"https:\/\/gulass.cn\/?p=117427"},"modified":"2018-08-27T11:06:05","modified_gmt":"2018-08-27T03:06:05","slug":"centos-openssl-openssh","status":"publish","type":"post","link":"https:\/\/gulass.cn\/centos-openssl-openssh.html","title":{"rendered":"\u7ec6\u8ff0CentOS\u4f7f\u7528OpenSSL\u7f16\u8bd1\u5b89\u88c5OpenSSH"},"content":{"rendered":"
<\/p>\n
\r\n# rpm -qa | grep openssh openssh\r\n# rpm -qa | grep openssh openssl\r\n<\/pre>\n\u5378\u8f7d\u7528rpm -e \u5982\u679c\u51fa\u73b0\u4f9d\u8d56\u5305\u5bfc\u81f4\u65e0\u6cd5\u5378\u8f7d\uff0c\u5728\u6700\u540e\u9762\u52a0\u4e0a--nodeps\u5373\u53ef,\u4f8b\uff1a<\/p>\n
\r\n# rpm -e openssl --nodeps\r\n<\/pre>\n\u5177\u4f53\u5b89\u88c5\u8fc7\u7a0b\u5982\u4e0b\uff1a<\/p>\n
\u4e0b\u8f7d\u6700\u65b0\u8f6f\u4ef6\u5305\u6e90\u7801<\/strong><\/span><\/div>\n\r\nhttp:\/\/ftp5.usa.openbsd.org\/pub\/OpenBSD\/OpenSSH\/portable\/openssh-7.3p1.tar.gz\r\nhttp:\/\/www.openssl.org\/source\/openssl-1.0.2j.tar.gz\r\nhttp:\/\/www.openssl.org\/source\/openssl-fips-2.0.13.tar.gz\r\n<\/pre>\n\u4f7f\u7528YUM\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5f00\u53d1\u5305<\/strong><\/span><\/div>\n\r\n# yum install -y zlib-devel pam-devel tcp_wrappers-devel\r\n<\/pre>\n\u5b89\u88c5openssl-fips<\/strong><\/span><\/div>\n\u5177\u4f53\u8bf4\u660e\u89c1 http:\/\/www.openssl.org\/docs\/fips ;<\/p>\n
\r\n# tar zxpf openssl-fips-2.0.5.tar.gz\r\n# cd openssl-fips\r\n# .\/config\r\n# make && make install\r\n<\/pre>\n\u5b89\u88c5OpenSSL<\/strong><\/span><\/div>\n\r\n# tar zxpf openssl-1.0.1h.tar.gz\r\n# cd openssl-1.0.1h\r\n# .\/config fips --shared\r\n# make && make install \r\n<\/pre>\n\u5c06\u65b0\u7f16\u8bd1\u7684openssl library \u52a0\u5165\u7cfb\u7edf\u52a8\u6001\u5e93\u94fe\u63a5\u4e2d<\/strong><\/span><\/div>\n\r\n# echo \"\/usr\/local\/ssl\/lib\" >> \/etc\/ld.so.conf\r\n# ldconfig\r\n<\/pre>\n\u5b89\u88c5OpenSSH<\/strong><\/span><\/div>\n\r\n# tar zxpf openssh-6.6p1.tar.gz\r\n# cd openssh-6.6p1\r\n# .\/configure \\\r\n --prefix=\/usr \\\r\n --sysconfdir=\/etc\/ssh \\\r\n --with-md5-passwords \\\r\n --with-pam \\\r\n --with-tcp-wrappers \\\r\n --with-ssl-dir=\/usr\/local\/ssl\r\n# make && make install\r\n# ssh -V\r\n<\/pre>\n\u4fee\u6539\u76f8\u5173\u914d\u7f6e<\/strong><\/span><\/div>\n\r\n# cp -p contrib\/redhat\/sshd.init \/etc\/init.d\/sshd (\u6b64\u5904\u7684contrib\u8def\u5f84\u4e3a\u89e3\u538b\u540e\u7684OpenSSH\u5305\u8def\u5f84)\r\n# chmod u+x \/etc\/init.d\/sshd \uff08\u52a0\u6267\u884c\u6743\u9650\uff09\r\n# chkconfig --add sshd \uff08\u589e\u52a0sshd\u670d\u52a1\uff09\r\n# chkconfig sshd on \uff08\u628asshd\u52a0\u5165\u542f\u52a8\u9879\uff09\r\n# yum install openssh (\u5b89\u88c5OpenSSH\u5ba2\u6237\u7aef)\r\n# vim \/etc\/ssh\/sshd_config\r\nPermitRootLogin yes #\u5141\u8bb8root\u8d26\u6237\u767b\u5f55\uff0c\u5355root\u8d26\u6237\u5fc5\u987b\u52a0\u4e0a\uff0c\u5176\u4ed6\u7684\u53c2\u6570\u8bf7\u81ea\u884c\u4fee\u6539\r\n<\/pre>\n\u6d4b\u8bd5\u767b\u5f55<\/strong><\/span><\/div>\n\r\n# \/etc\/init.d\/sshd start\r\nssh-keygen: illegal option -- A\r\n\r\nUsage: ssh-keygen [options]\r\n\r\nOptions:\r\n\r\n-a trials Number of trials for screening DH-GEX moduli.\r\n\r\n-B Show bubblebabble digest of key file.\r\n\r\n-b bits Number of bits in the key to create.\r\n\r\n-C comment Provide new comment.\r\n\r\n-c Change comment in private and public key files.\r\n\r\n-e Convert OpenSSH to IETF SECSH key file.\r\n\r\n-F hostname Find hostname in known hosts file.\r\n\r\n-f filename Filename of the key file.\r\n\r\n-G file Generate candidates for DH-GEX moduli.\r\n\r\n-g Use generic DNS resource record format.\r\n\r\n-H Hash names in known_hosts file.\r\n\r\n-i Convert IETF SECSH to OpenSSH key file.\r\n\r\n-l Show fingerprint of key file.\r\n\r\n-M memory Amount of memory (MB) to use for generating DH-GEX moduli.\r\n\r\n-N phrase Provide new passphrase.\r\n\r\n-P phrase Provide old passphrase.\r\n\r\n-p Change passphrase of private key file.\r\n\r\n-q Quiet.\r\n\r\n-R hostname Remove host from known_hosts file.\r\n\r\n-r hostname Print DNS resource record.\r\n\r\n-S start Start point (hex) for generating DH-GEX moduli.\r\n\r\n-T file Screen candidates for DH-GEX moduli.\r\n\r\n-t type Specify type of key to create.\r\n\r\n-v Verbose.\r\n\r\n-W gen Generator to use for generating DH-GEX moduli.\r\n\r\n-y Read private key file and print public key.\r\n\r\nStarting sshd: [ OK ]\r\n<\/pre>\nsshd\u6587\u4ef6\u7684ssh-keygen\u53c2\u6570\u6709\u95ee\u9898\uff0c\u6682\u65f6\u4e0d\u77e5\u9053\u600e\u4e48\u89e3\u51b3\uff0c\u4f46\u662f\u4e0d\u5f71\u54cd\u4f7f\u7528\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/wuxiaobai.win\/archives\/29<\/a><\/p>\n