Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Tag Archives: RHEL

Oneliner to extract CentOS Stream package source in dist-git repo

-While investigating the sources of RHEL and Fedora packages, firstly I switch to corresponding branch, then do either rhpkg prep or fedpkg prep to extract source.

Recently, I am interested in CentOS Stream 9, and wish to investigate the source. However, I am too lazy to find the fedpkg or rhpkg equivalent for CentOS Stream, and found the following command useful:

/bin/spectool -g $(basename $PWD).spec; /bin/rpmbuild --nodeps --define "_sourcedir $PWD" --define "_builddir $PWD" --define "_buildrootdir $PWD" -bp $(basename $PWD).spec

SSH Troubleshoot: Having valid key but still fall back to password

Do you have a valid key and the public key is ~/.ssh/authoried_keys of target ssh server, but you still need to type password? Here is the checklist you can refer:

  1. ~/.ssh  and its content should not have read/write permission for other users
    cd ; chmod og-rw .ssh
  2. Same goes with your remote directory ~/.ssh
  3. Your server home directory should not have read/write permission for other users
    cd ~/..; chmod o-rw <homeDir>
  4. If SELinux is enforced in server, make sure the SELinux type of ~/.ssh in server is user_ssh_home_tcd;  ls -dZ .ssh   # to list the SELinux type of ~/.ssh
    chcon -R -t user_ssh_home_t .ssh
  5. ssh -vvv <login@server> to get more information on the local side.
  6. See server log /var/log/secure for sshd output. Change LogLevel to DEBUG3  in /etc/ssh/sshd_config and restart sshd to get more detail debugging messages.
  7. See server log /var/log/audit/audit.log for SELinux log.

Note that this checking is for Fedora and RHEL. Yet you can change the path of files to accommodate your system.