CentOS 8にpoppassdをインストールしてみました。
今回も下記サイトのプログラムをインストールしてみます。
kravietz/poppassd-ceti
https://github.com/kravietz/poppassd-ceti
検証環境
・CentOS Linux release 8.2.2004 (Core)
・Kernel 4.18.0-193.6.3.el8_2.x86_64
- 開発環境のインストール
- 必要なモジュールのインストール
- xinetdのインストール
- git clone
- cmake
- 再度cmake
- make
- poppassdのCopy
- /etc/pam.d/poppassdの作成
- /etc/xinetd.d/poppassdの作成
- /etc/servicesの確認
- xinetdの起動
- 動作確認
開発環境をインストールしていない場合はインストールして下さい。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[root@centos8 ~]# dnf -y groupinstall "Development Tools" [root@centos8 ~]# dnf grouplist Available Environment Groups: Server with GUI Server Workstation Virtualization Host Custom Operating System Installed Environment Groups: Minimal Install Installed Groups: Development Tools Security Tools System Tools Available Groups: Container Management .NET Core Development RPM Development Tools Graphical Administration Tools Headless Management Legacy UNIX Compatibility Network Servers Scientific Support Smart Card Support |
kravietz/poppassd-cetiがVersion 1.8.8になりcmake(require cmake 3.12 (bionic)
)が必須になりました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
[root@centos8 ~]# dnf -y install pam-devel cmake Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: cmake x86_64 3.11.4-7.el8 AppStream 8.1 M pam-devel x86_64 1.3.1-8.el8 BaseOS 209 k Installing dependencies: cmake-data noarch 3.11.4-7.el8 AppStream 1.3 M cmake-filesystem x86_64 3.11.4-7.el8 AppStream 40 k cmake-rpm-macros noarch 3.11.4-7.el8 AppStream 39 k libuv x86_64 1:1.23.1-1.el8 AppStream 134 k Transaction Summary ================================================================================ Install 6 Packages Total download size: 9.9 M Installed size: 29 M Downloading Packages: (1/6): cmake-filesystem-3.11.4-7.el8.x86_64.rpm 396 kB/s | 40 kB 00:00 (2/6): cmake-rpm-macros-3.11.4-7.el8.noarch.rpm 1.4 MB/s | 39 kB 00:00 (3/6): libuv-1.23.1-1.el8.x86_64.rpm 2.8 MB/s | 134 kB 00:00 (4/6): cmake-data-3.11.4-7.el8.noarch.rpm 6.0 MB/s | 1.3 MB 00:00 (5/6): pam-devel-1.3.1-8.el8.x86_64.rpm 1.2 MB/s | 209 kB 00:00 (6/6): cmake-3.11.4-7.el8.x86_64.rpm 14 MB/s | 8.1 MB 00:00 -------------------------------------------------------------------------------- Total 5.1 MB/s | 9.9 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : cmake-rpm-macros-3.11.4-7.el8.noarch 1/6 Installing : cmake-filesystem-3.11.4-7.el8.x86_64 2/6 Installing : libuv-1:1.23.1-1.el8.x86_64 3/6 Installing : cmake-data-3.11.4-7.el8.noarch 4/6 Installing : cmake-3.11.4-7.el8.x86_64 5/6 Installing : pam-devel-1.3.1-8.el8.x86_64 6/6 Running scriptlet: pam-devel-1.3.1-8.el8.x86_64 6/6 Verifying : cmake-3.11.4-7.el8.x86_64 1/6 Verifying : cmake-data-3.11.4-7.el8.noarch 2/6 Verifying : cmake-filesystem-3.11.4-7.el8.x86_64 3/6 Verifying : cmake-rpm-macros-3.11.4-7.el8.noarch 4/6 Verifying : libuv-1:1.23.1-1.el8.x86_64 5/6 Verifying : pam-devel-1.3.1-8.el8.x86_64 6/6 Installed: cmake-3.11.4-7.el8.x86_64 cmake-data-3.11.4-7.el8.noarch cmake-filesystem-3.11.4-7.el8.x86_64 cmake-rpm-macros-3.11.4-7.el8.noarch libuv-1:1.23.1-1.el8.x86_64 pam-devel-1.3.1-8.el8.x86_64 Complete! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
[root@centos8 ~]# dnf -y install xinetd Last metadata expiration check: 0:09:38 ago on Fri Jul 3 09:55:26 2020. Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: xinetd x86_64 2:2.3.15-24.el8 AppStream 135 k Transaction Summary ================================================================================ Install 1 Package Total download size: 135 k Installed size: 379 k Downloading Packages: xinetd-2.3.15-24.el8.x86_64.rpm 1.1 MB/s | 135 kB 00:00 -------------------------------------------------------------------------------- Total 47 kB/s | 135 kB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : xinetd-2:2.3.15-24.el8.x86_64 1/1 Running scriptlet: xinetd-2:2.3.15-24.el8.x86_64 1/1 Verifying : xinetd-2:2.3.15-24.el8.x86_64 1/1 Installed: xinetd-2:2.3.15-24.el8.x86_64 Complete! |
1 2 3 4 5 6 7 8 |
[root@centos8 ~]# git clone https://github.com/kravietz/poppassd-ceti.git Cloning into 'poppassd-ceti'... remote: Enumerating objects: 86, done. remote: Counting objects: 100% (86/86), done. remote: Compressing objects: 100% (62/62), done. remote: Total 251 (delta 47), reused 57 (delta 23), pack-reused 165 Receiving objects: 100% (251/251), 106.25 KiB | 346.00 KiB/s, done. Resolving deltas: 100% (136/136), done. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@centos8 ~]# cd poppassd-ceti/ [root@centos8 poppassd-ceti]# ls -l total 52 -rw-r--r--. 1 root root 197 Jul 2 10:06 CMakeLists.txt -rw-r--r--. 1 root root 18026 Jul 2 10:06 LICENSE -rw-r--r--. 1 root root 6244 Jul 2 10:06 README.md -rw-r--r--. 1 root root 264 Jul 2 10:06 config.h.in -rw-r--r--. 1 root root 8442 Jul 2 10:06 poppassd.c -rwxr-xr-x. 1 root root 857 Jul 2 10:06 test.sh [root@centos8 poppassd-ceti]# cmake . CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.12 or higher is required. You are running version 3.11.4 -- Configuring incomplete, errors occurred! |
CentOS 8の最新なのに”CMake 3.12 or higher is required. You are running version 3.11.4“だと。
取り合えずCMakeLists.txtを編集して3.11にします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@centos8 poppassd-ceti]# cat CMakeLists.txt cmake_minimum_required(VERSION 3.12) project(poppassd VERSION 1.8.8) configure_file(config.h.in config.h) add_executable(poppassd poppassd.c config.h) target_link_libraries(poppassd PRIVATE pam) [root@centos8 poppassd-ceti]# vi CMakeLists.txt [root@centos8 poppassd-ceti]# cat CMakeLists.txt cmake_minimum_required(VERSION 3.11) project(poppassd VERSION 1.8.8) configure_file(config.h.in config.h) add_executable(poppassd poppassd.c config.h) target_link_libraries(poppassd PRIVATE pam) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
[root@centos8 poppassd-ceti]# cmake . -- The C compiler identification is GNU 8.3.1 -- The CXX compiler identification is GNU 8.3.1 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /root/poppassd-ceti [root@centos8 poppassd-ceti]# ls -l total 88 -rw-r--r--. 1 root root 13163 Jul 2 10:11 CMakeCache.txt drwxr-xr-x. 5 root root 4096 Jul 2 10:11 CMakeFiles -rw-r--r--. 1 root root 197 Jul 2 10:10 CMakeLists.txt -rw-r--r--. 1 root root 18026 Jul 2 10:06 LICENSE -rw-r--r--. 1 root root 4756 Jul 2 10:11 Makefile -rw-r--r--. 1 root root 6244 Jul 2 10:06 README.md -rw-r--r--. 1 root root 1484 Jul 2 10:11 cmake_install.cmake -rw-r--r--. 1 root root 195 Jul 2 10:11 config.h -rw-r--r--. 1 root root 264 Jul 2 10:06 config.h.in -rw-r--r--. 1 root root 8442 Jul 2 10:06 poppassd.c -rwxr-xr-x. 1 root root 857 Jul 2 10:06 test.sh |
poppassdが作成されました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@centos8 poppassd-ceti]# make Scanning dependencies of target poppassd [ 50%] Building C object CMakeFiles/poppassd.dir/poppassd.c.o [100%] Linking C executable poppassd [100%] Built target poppassd [root@centos8 poppassd-ceti]# ls -l total 108 -rw-r--r--. 1 root root 13163 Jul 3 10:11 CMakeCache.txt drwxr-xr-x. 5 root root 4096 Jul 3 10:18 CMakeFiles -rw-r--r--. 1 root root 197 Jul 3 10:10 CMakeLists.txt -rw-r--r--. 1 root root 18026 Jul 3 10:06 LICENSE -rw-r--r--. 1 root root 4756 Jul 3 10:11 Makefile -rw-r--r--. 1 root root 6244 Jul 3 10:06 README.md -rw-r--r--. 1 root root 1484 Jul 3 10:11 cmake_install.cmake -rw-r--r--. 1 root root 195 Jul 3 10:11 config.h -rw-r--r--. 1 root root 264 Jul 3 10:06 config.h.in -rwxr-xr-x. 1 root root 18472 Jul 3 10:18 poppassd -rw-r--r--. 1 root root 8442 Jul 3 10:06 poppassd.c -rwxr-xr-x. 1 root root 857 Jul 3 10:06 test.sh |
1 |
[root@centos8 poppassd-ceti]# cp poppassd /usr/local/sbin/ |
1 2 3 4 5 |
[root@centos8 ~]# vi /etc/pam.d/poppassd [root@centos8 ~]# cat /etc/pam.d/poppassd auth include system-auth account include system-auth password include system-auth |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@centos8 ~]# vi /etc/xinetd.d/poppassd [root@centos8 ~]# cat /etc/xinetd.d/poppassd service poppassd { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/poppassd log_on_success += USERID log_on_failure += USERID only_from = 127.0.0.1 } |
1 2 3 4 5 6 7 |
[root@centos8 ~]# grep poppassd /etc/services # unfortunately the poppassd (Eudora) uses a port which has already # been assigned to a different service. We list the poppassd as an #3com-tsmux 106/tcp poppassd #3com-tsmux 106/udp poppassd poppassd 106/tcp # Eudora poppassd 106/udp # Eudora |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[root@centos8 ~]# systemctl enable xinetd [root@centos8 ~]# systemctl start xinetd [root@centos8 ~]# systemctl status xinetd * xinetd.service - Xinetd A Powerful Replacement For Inetd Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor pres> Active: active (running) since Fri 2020-07-02 10:37:58 JST; 9s ago Docs: man:xinetd man:xinetd.conf man:xinetd.log Process: 6731 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.> Main PID: 6732 (xinetd) Tasks: 1 (limit: 49603) Memory: 1.0M CGroup: /system.slice/xinetd.service `-6732 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing daytime Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing discard Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing discard Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing echo Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing echo Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing tcpmux Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing time Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: removing time Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: xinetd Version 2.3.15 start> Jul 02 10:37:58 centos8.rootlinks.net xinetd[6732]: Started working: 1 availabl> |
passコマンドの送信後少し応答時間が掛かりましたが、取り合えず動いていそうです。
応答時間についてはネットワーク系なのかPAM認証なのか調べていません(^^;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[root@centos8 ~]# useradd guest [root@centos8 ~]# passwd guest Changing password for user guest. New password: BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word Retype new password: passwd: all authentication tokens updated successfully. [root@centos8 ~]# telnet 127.0.0.1 106 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 200 poppassd user guest 200 Your password please pass Qazwsx123 200 Your new password please newpass Mkoijn098 200 Password changed quit 200 Bye Connection closed by foreign host. |