标签:log libc 加速 licence *** gen from make htm
最近玩ansible发现ansible的执行速度实在是太慢了,看网上说openssh可以加快ansible的执行速度,于是就开启了openssh源码安装的填坑之旅!mkdir -p /root/openssh
cd /root/openssh
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
yum install -y zlib-devel pam-devel tcp_wrappers-devel gcc
yum install openssl openssl-devel -y
这里如果不安装openssl-devel下面配置的时候会报错
configure:error *** working libcrypto not found check config.log
按照http://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssh.html的步骤安装
install -v -m700 -d /var/lib/sshd &&
chown -v root:sys /var/lib/sshd &&groupadd -g 50 sshd &&
useradd -c ‘sshd PrivSep‘ \
-d /var/lib/sshd \
-g sshd \
-s /bin/false \
-u 50 sshd
安装
./configure --prefix=/usr \
--sysconfdir=/etc/ssh \
--with-md5-passwords \
--with-privsep-path=/var/lib/sshd &&
make
在编译之前,之前这三条命令,否则编译过程中会报很漂亮的错误
没骗你吧,很漂亮吧。
make install &&
install -v -m755 contrib/ssh-copy-id /usr/bin &&install -v -m644 contrib/ssh-copy-id.1 \
/usr/share/man/man1 &&
install -v -m755 -d /usr/share/doc/openssh-8.0p1 &&
install -v -m644 INSTALL LICENCE OVERVIEW README* \
/usr/share/doc/openssh-8.0p1
然后客户端
生成私钥和公钥
ssh-keygen -t rsa
在~/.ssh/中会生成两个文件 id_rsa.pub和id_rsa
id_rsa是密钥,id_rsa.pub是公钥,将id_rsa.pub放到server的~/.ssh/文件夹中
ssh root@172.18.74.59 "cat >> ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub
将公钥加入本机的authorized_keys
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
启动ssh服务
/usr/sbin/sshd
这样就可以免密登陆对端主机和本机了
标签:log libc 加速 licence *** gen from make htm
原文地址:https://blog.51cto.com/13670314/2400120