Coder Social home page Coder Social logo

centos-pam-with-update-motd's Introduction

Hi, I am Greg! ๐Ÿ‘‹

I am a devops engineer with nearly 20 years of experience of breaking and fixing stuff professionally. ๐Ÿง”โ€โ™‚๏ธ

I really enjoy coding in Python and I am learning Rust but I do not shy away from coding a little in Ruby, Golang and many other languages. ๐Ÿ˜Š

My principle is the "boy scout rule": I try to leave the projects I encounter on my path a tiny bit better than they were before. Sometimes that ends up with a little more than a tiny bit though. ๐Ÿ˜…

My GitHub stats

gdubicki's GitHub stats

My Stack Exchange

profile for Greg Dubicki on Stack Exchange, a network of free, community-driven Q&A sites

centos-pam-with-update-motd's People

Contributors

gdubicki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

centos-pam-with-update-motd's Issues

Issue with libpam.so.0 ?

Attempted to use this on CentOS Linux release 7.7.1908 (Core), but it appears there might be an issue with libpam.so.0 ...

$ yum install https://github.com/gdubicki/centos-pam-with-update-motd/releases/download/1.1.8-1022.3/pam-1.1.8-1022.el7.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
pam-1.1.8-1022.el7.x86_64.rpm | 726 kB 00:00:00
Examining /var/tmp/yum-root-9Ob7rX/pam-1.1.8-1022.el7.x86_64.rpm: pam-1.1.8-1022.el7.x86_64
Marking /var/tmp/yum-root-9Ob7rX/pam-1.1.8-1022.el7.x86_64.rpm as an update to pam-1.1.8-22.el7.x86_64
Marking /var/tmp/yum-root-9Ob7rX/pam-1.1.8-1022.el7.x86_64.rpm as an update to pam-1.1.8-22.el7.i686
Resolving Dependencies
--> Running transaction check
---> Package pam.i686 0:1.1.8-22.el7 will be updated
--> Processing Dependency: libpam.so.0 for package: systemd-libs-219-67.el7_7.2.i686
Loading mirror speeds from cached hostfile

  • base: mirrors.cat.pdx.edu
  • elrepo: repos.ord.lax-noc.com
  • epel: sjc.edge.kernel.org
  • extras: mirrors.unifiedlayer.com
  • rpmfusion-free-updates: muug.ca
  • rpmfusion-nonfree-updates: muug.ca
  • updates: repos.lax.layerhost.com
    --> Processing Dependency: libpam.so.0(LIBPAM_1.0) for package: systemd-libs-219-67.el7_7.2.i686
    --> Processing Dependency: libpam.so.0(LIBPAM_EXTENSION_1.0) for package: systemd-libs-219-67.el7_7.2.i686
    --> Processing Dependency: libpam.so.0(LIBPAM_MODUTIL_1.0) for package: systemd-libs-219-67.el7_7.2.i686
    --> Processing Dependency: libpam_misc.so.0 for package: systemd-libs-219-67.el7_7.2.i686
    --> Processing Dependency: libpam_misc.so.0(LIBPAM_MISC_1.0) for package: systemd-libs-219-67.el7_7.2.i686
    ---> Package pam.x86_64 0:1.1.8-22.el7 will be updated
    ---> Package pam.x86_64 0:1.1.8-1022.el7 will be an update
    --> Finished Dependency Resolution
    Error: Package: systemd-libs-219-67.el7_7.2.i686 (@updates)
    Requires: libpam.so.0
    Removing: pam-1.1.8-22.el7.i686 (@base)
    libpam.so.0
    Updated By: pam-1.1.8-1022.el7.x86_64 (/pam-1.1.8-1022.el7.x86_64)
    Not found
    You could try using --skip-broken to work around the problem

Unable to get this working on CentOS 7.8 [SELinux issue]

Thanks for your work on this. I love this capability in Ubuntu and find it unfortunate that there's no analog for RedHat. I went through the instructions (RPM install; not built from source) and double checked everything but I'm unable to get my dynamic motd when I ssh to the server.

CentOS Linux release 7.8.2003 (Core)

It does however work when I run:

sudo run-parts-debian --lsbsysinit /etc/update-motd.d

Interesting to note that, as part of troubleshooting, I renamed my /etc/update-motd.d/10-sysinfo script to /etc/update-motd.d/10_sysinfo and that stopped the above command from working. It appears that the two proper nomenclatures are:

  • 10-sysinfo
  • 10sysinfo

Regardless, SSH yields nothing. I'll keep trying things and update this thread if I find a solution. If you have any ideas in the meantime, let me know. Again, thanks for the effort.

Keep the colors

When you use this solution then all the colors that you might get from your scripts are lost and turned into your default terminal black-on-white/white-on-black set.

(I am marking it a feature, not a bug, because this is how the original solution works.)

Replace with a ~custom~ built-in PAM module

The main thing I would like to do is to run https://github.com/gdubicki/dynamotd (or a different program) to show a colored, dynamic MOTD on Centos 7 and Rocky 8.

And this solution for Centos 7 is only working for dynamic MOTD without colors - it is NOT working with colors (yet - see #3), not working on Rocky 8 and requires SELinux to be disabled.

I am starting to think that instead of hacking PAM itself and its built-in modules we should rather create a custom PAM module that will only run a specific program and show that as a MOTD. I am hoping that although the initial effort will be significant - I have little experience with coding in C - but the result will be a much cleaner and easier to maintain solution.

Note to self: check out https://github.com/beatgammit/simple-pam.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.