openssh 7.6p1编译打包

新版本代码获取

从官网下载 https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-7.6p1.tar.gz

编译RPM包注意事项

需要注意新版的openssh的spec文件里使用的pam配置文件会导致无法登陆

#%PAM-1.0
auth       required     pam_stack.so service=system-auth
account    required     pam_nologin.so
account    required     pam_stack.so service=system-auth
password   required     pam_stack.so service=system-auth
session    required     pam_stack.so service=system-auth

需要修改为

#%PAM-1.0
auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth

spec文件在./contrib/redhat下,可以直接rpmbuild -ba openssh.spec 编译。

此条目发表在System分类目录。将固定链接加入收藏夹。

发表评论