Hi All,
I was tinkering around with trying to generate an SSH Banner file that mirrors the text produced by agetty when it processes Issue files.So far so good. My naive thought was to put this into a cron entry but of course it fails because agetty insists on having a terminal to get attributes from in order to expand the variables it may encounter in the issue files.
My cron entry to run that command every four hours:produces:Of course I can manually run the command from a terminal window but I thought there must be some way I can get this to work as a background task not requiring a terminal session.
Has anyone come up with a technique that works for scheduling the reprocessing of issue files to produce the expanded text equivalent?
I was tinkering around with trying to generate an SSH Banner file that mirrors the text produced by agetty when it processes Issue files.
Code:
# /usr/sbin/agetty --issue-file /etc/issue.net:/etc/issue.d --show-issueDebian GNU/Linux 12IP4 (ens33): 192.168.77.147
My cron entry to run that command every four hours:
Code:
0 0-23/4 * * * root /usr/sbin/agetty --issue-file /etc/issue.net:/etc/issue.d --show-issue > /etc/ssh/sshd_config.d/50Banner.txt 2>&1
Code:
agetty: failed to get terminal attributes: Inappropriate ioctl for device: Inappropriate ioctl for device
Has anyone come up with a technique that works for scheduling the reprocessing of issue files to produce the expanded text equivalent?
Statistics: Posted by shawnb — 2024-03-01 19:38 — Replies 2 — Views 78