编译安装升级openssh小结

这篇博客详细总结了如何编译、安装和升级OpenSSH的过程,是Oracle技术爱好者的技术分享,旨在帮助读者掌握这一关键的安全连接工具。
1)检查现在版本
[root@wilson]# ssh -V
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
2)上传软件到指定目录/soft
3)解压需要安装文件
[root@wilson]#gunzip openssh-4.4p1.tar.gz
[root@wilson]#tar –xvf openssh-4.4p1.tar
4) 编译补丁包
[root@wilson]./configure
configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for gawk... gawk
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for egrep... (cached) /bin/grep -E
……
……
checking for ent... no
checking for getutxent... yes
checking for getutxid... yes
……
……
checking for getutxline... yes
checking for pututxline... yes
checking for setutxent... yes
checking for utmpxname... yes
checking for daemon... yes
checking for getpagesize... yes
checking whether snprintf correctly terminates long strings... yes
checking whether snprintf can declare const char *fmt... yes
checking whether system supports SO_PEERCRED getsockopt... yes
checking for (overly) strict mkstemp... yes
checking if openpty correctly handles controlling tty... yes
checking whether getpgrp requires zero arguments... yes
checking OpenSSL header version... 90802f (OpenSSL 0.9.8e-rhel5 01 Jul 2008)
checking OpenSSL library version... 90802f (OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008)
checking whether OpenSSL's headers match the library... yes
checking if programs using OpenSSL functions will link... yes
checking whether OpenSSL has crippled AES support... no
checking for crypt in -lcrypt... yes
checking for SHA256_Update... yes
checking for EVP_sha256... yes
checking for ia_openinfo in -liaf... no
checking whether OpenSSL's PRNG is internally seeded... yes
checking for ls... /bin/ls
checking for netstat... /bin/netstat
checking for arp... /sbin/arp
checking for ifconfig... /sbin/ifconfig
checking for jstat... no
checking for ps... /bin/ps
checking for sar... /usr/bin/sar
checking for w... /usr/bin/w
checking for who... /usr/bin/who
checking for last... /usr/bin/last
checking for lastlog... /usr/bin/lastlog
checking for df... /bin/df
checking for vmstat... /usr/bin/vmstat
checking for uptime... /usr/bin/uptime
checking for ipcs... /usr/bin/ipcs
checking for tail... /usr/bin/tail
checking for long long... yes
checking for unsigned long long... yes
checking for long double... yes
checking for char... yes
checking size of char... 1
checking for short int... yes
checking size of short int... 2
checking for int... yes
checking size of int... 4
checking for long int... yes
checking size of long int... 4
checking for long long int... yes
checking size of long long int... 8
checking for u_int type... yes
checking for intXX_t types... yes
checking for int64_t type... yes
checking for u_intXX_t types... yes
checking for u_int64_t types... yes
checking for uintXX_t types in stdint.h... yes
checking for u_char... yes
checking for socklen_t... yes
checking for sig_atomic_t... yes
checking for in_addr_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for clock_t... yes
checking for sa_family_t... yes
checking for pid_t... yes
checking for mode_t... yes
checking for struct sockaddr_storage... yes
checking for struct sockaddr_in6... yes
checking for struct in6_addr... yes
checking for struct addrinfo... yes
checking for struct timeval... yes
checking for struct timespec... yes
checking for ut_host field in utmp.h... yes
checking for ut_host field in utmpx.h... yes
checking for syslen field in utmpx.h... no
checking for ut_pid field in utmp.h... yes
checking for ut_type field in utmp.h... yes
checking for ut_type field in utmpx.h... yes
checking for ut_tv field in utmp.h... yes
checking for msg_accrights field in struct msghdr... no
checking whether va_copy exists... yes
checking whether _getlong is declared... no
checking for HEADER.ad... yes
checking for xauth... /usr/bin/xauth
checking for "/dev/ptc"... no
checking for nroff... /usr/bin/nroff
checking if the systems has expire shadow information... yes
checking for "/etc/default/login"... no
Adding /usr/local/bin to USER_PATH so scp will work
checking if we need to convert IPv4 in IPv6-mapped addresses... yes ( default)
checking if your system defines LASTLOG_FILE... no
checking if your system defines _PATH_LASTLOG... yes
checking if your system defines UTMP_FILE... yes
checking
在CentOS中,如果你手动编译安装OpenSSH服务器,删除它通常需要一些额外步骤,因为编译安装的文件可能会分布在不同的目录中。以下是删除步骤: 1. **停止服务**:首先确保服务已经停止,可以运行以下命令: ``` sudo systemctl stop openssh-server ``` 2. **移除配置文件**:从/etc目录下删除ssh相关的配置文件,如`sshd_config`: ``` sudo rm /etc/ssh/sshd_config ``` 3. **删除binaries**:找到OpenSSH的可执行文件,通常是`/usr/local/bin/ssh`或其他类似位置,然后删除: ``` sudo rm /usr/local/bin/ssh* # 删除所有SSH相关二进制文件 ``` 4. **删除share目录**:如果在`/usr/share/man/man1`或`/usr/share/doc/openssh-client`等地方有文档或手册页,也一删除: ``` sudo rm -r /usr/share/man/man1/openssh* sudo rm -r /usr/share/doc/openssh* ``` 5. **删除include目录**:如果有SSH的头文件,一般位于`/usr/include/openssl/ssh`,也需要移除: ``` sudo rm -r /usr/include/openssl/ssh ``` 6. **删除lib目录**:检查是否在`/usr/lib64`或`/usr/lib`有OpenSSH的库文件,删除: ``` sudo find /usr/lib -name "libssh*" -type f -delete sudo find /usr/lib64 -name "libssh*" -type f -delete ``` 7. **清理可能存在的链接**:确保没有残余的软连接指向已删除的目录: ``` sudo rm -f /etc/alternatives/ssh sudo rm -rf /var/run/sshd ``` 8. **刷新包数据库**:最后,更新RPM缓存,以防遗漏任何依赖项: ``` sudo yum clean all ``` 完成以上步骤后,你应该成功地删除了编译安装OpenSSH。但请注意,在执行删除操作前最好先备份重要数据,以防意外丢失。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值