The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
Linux displays the Message of the Day (MOTD) through PAM after a successful login. On a traditional installation, edit /etc/motd; on Ubuntu and Debian systems using update-motd, create or modify an executable script in /etc/update-motd.d instead. If a message appears over SSH but not at the console, or vice versa, check both the SSH daemon’s PrintMotd setting and the session’s pam_motd.so configuration.
How Linux decides which MOTD to display
The text shown after login is not always read from one file. The usual display path is the PAM pam_motd session module. After authentication succeeds, PAM reads one or more message files and writes their contents to the login session. A distribution can also generate those files at login, or the SSH daemon can independently decide whether to print a message.
The documented pam_motd search locations include the static files /etc/motd, /run/motd, and /usr/lib/motd, plus the corresponding motd.d directories. Files in each directory are shown in lexicographic order. An entry in /etc takes precedence over an identically named entry in /run or /usr/lib. Each individual message is limited to 64 KB according to the current Ubuntu Noble pam_motd manual.
That gives you three practical customization models:
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
- Static file: one administrator-managed message, normally
/etc/motd. - Fragments: several files in a
motd.ddirectory, combined in filename order. - Generated output: executable scripts run at login, with their standard output assembled into a runtime file such as
/run/motd.dynamic.
Before editing anything, determine which model your distribution and login path are using. Otherwise, a correct edit may be ignored or overwritten.
Identify the active MOTD mechanism
Inspect the files and links
Start by checking whether /etc/motd is a regular file or a symbolic link, and whether the dynamic-script directory exists.
ls -l /etc/motd /run/motd /usr/lib/motd 2>/dev/null
ls -ld /etc/motd.d /run/motd.d /usr/lib/motd.d 2>/dev/null
ls -ld /etc/update-motd.d 2>/dev/null
On Ubuntu installations using update-motd, /etc/motd is typically a symlink to a generated file in /run. In that case, editing the generated target directly is temporary and editing the symlink target may not affect how the next login is assembled.
Check the PAM session rules
Look for pam_motd.so in the service that starts your session. A local console login commonly uses /etc/pam.d/login; an SSH login commonly uses /etc/pam.d/sshd.
grep -R --line-number --fixed-strings pam_motd.so /etc/pam.d/login /etc/pam.d/sshd 2>/dev/null
If neither file contains the module, inspect the PAM include files referenced by those files. A distribution may place the actual rule in a shared session configuration. Do not add a second MOTD rule until you understand the existing include chain, or the message can be printed twice.
Separate console behavior from SSH behavior
A console and an SSH session can use different PAM services and different daemon settings. Test both paths after every change. If the text appears in one path only, the difference is usually configuration rather than file permissions.
Set a static MOTD in /etc/motd
When a static file is the right choice
Use a static file when the system reads /etc/motd directly and you want the same plain text for every login. This is the simplest approach for an access notice, a maintenance schedule, or a short operational reminder that does not need live data.
Replace the file safely
The following command writes the file as root and preserves the final newline required for clean terminal output.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
sudo sh -c 'cat > /etc/motd <<"EOF"
Authorized users only.
Maintenance window: Sundays 02:00 UTC.
EOF'
Use a quoted here-document delimiter so that shell characters inside the message are written literally. Read the result before testing a new session:
sudo cat /etc/motd
If the text does not appear, do not keep rewriting the file. Check the PAM rule, the SSH daemon setting, and whether /etc/motd is a symlink to generated output. Ubuntu systems using update-motd may replace or bypass this static content.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minutePreserve ownership and permissions
A MOTD is normally readable by all users but writable only by administrators. Confirm that the file is owned by root and is not writable by ordinary users:
sudo chown root:root /etc/motd
sudo chmod 644 /etc/motd
Do not put secrets, private keys, access tokens, or personal data in a world-readable login message. Every account that can log in may be able to read it.
Customize Ubuntu or Debian with update-motd
How dynamic generation works
Ubuntu introduced the update-motd framework, in which executable scripts in /etc/update-motd.d run as root at each login. Their standard output is concatenated into /run/motd.dynamic. On a typical Ubuntu setup, /etc/motd points to that generated file.
This design is useful for values that change, such as the hostname, kernel release, pending updates, or system load. It also means every script contributes work to every login, so scripts should finish quickly and should not depend on an unavailable network service.
Recommended Free Tools
Create a custom fragment
Create a file with a numeric prefix, no filename extension, and a shell interpreter on the first line:
sudo tee /etc/update-motd.d/90-custom >/dev/null <<'EOF'
#!/bin/sh
echo
echo "Welcome to $(hostname)"
echo "Kernel: $(uname -r)"
EOF
sudo chmod 755 /etc/update-motd.d/90-custom
The 90- prefix places this fragment after the lower-numbered vendor messages. Keep the name free of an extension such as .sh; the execution rules follow run-parts --lsbsysinit, which applies filename restrictions and orders accepted files numerically and alphabetically. The script must be executable, write its message to standard output, and end its output with a newline.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Preview the assembled message
Where the framework is present, run the same style of directory processing manually:
sudo run-parts --lsbsysinit /etc/update-motd.d
This prints the generated text without requiring a new SSH connection. It also reveals syntax errors, missing commands, and unexpected output from a newly added script.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Keep login scripts fast and reliable
A slow script delays every login. Avoid commands that make network requests, wait for a remote host, or scan a large filesystem. If a value is expensive to calculate, generate it on a timer and have the MOTD script read a cached local result. Handle command failures deliberately so that a missing service does not produce a shell error in every user’s session.
Remember that these scripts execute with root privileges. Use absolute paths for commands when practical, validate any data they read, and never echo credentials or unredacted service configuration.
Use motd.d fragments and suppress one message
Understand fragment precedence
Fragment directories are useful when several packages or administrators own different portions of the login text. Files are displayed in lexicographic order. A same-named file in /etc/motd.d overrides the corresponding file in /run/motd.d or /usr/lib/motd.d, allowing local policy to take precedence over packaged content.
List the directories in order to see what is contributing:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
sudo find /etc/motd.d /run/motd.d /usr/lib/motd.d -maxdepth 1 -type f -o -type l 2>/dev/null | sort
Because shell expression precedence can make that diagnostic broader than intended, use separate find commands if you need a precise inventory for a complex system.
Add a local static fragment
Create a numbered file in /etc/motd.d when your PAM implementation reads that directory:
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
sudo install -d -m 755 /etc/motd.d
sudo tee /etc/motd.d/90-local >/dev/null <<'EOF'
Local administration notice.
EOF
sudo chown root:root /etc/motd.d/90-local
sudo chmod 644 /etc/motd.d/90-local
The exact set of directories read is distribution-dependent, so confirm it in the local pam_motd documentation and PAM configuration.
Silence one packaged fragment
To disable a lower-precedence fragment without deleting a package-owned file, create a same-named symbolic link in /etc/motd.d that points to /dev/null. For example:
sudo ln -s /dev/null /etc/motd.d/50-motd-news
The local entry wins because /etc has higher precedence. Use the exact packaged filename, including its numeric prefix. If a package later changes the filename, the old override will no longer suppress the new fragment, so periodically review the directory after package updates.
Control MOTD output over SSH
Two settings can affect SSH output
Debian documents an sshd option named PrintMotd. Separately, PAM controls whether pam_motd.so runs for the SSH session. Either layer can prevent a message from appearing, and enabling both can produce duplicate or differently ordered output depending on the distribution’s configuration.
Inspect the effective SSH configuration rather than relying only on comments in the file:
sudo sshd -T | grep -i printmotd
grep -n --fixed-strings pam_motd.so /etc/pam.d/sshd 2>/dev/null
If you change sshd_config, validate the syntax before reloading the service:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallsudo sshd -t
Then reload the daemon using your distribution’s service manager. Keep an existing administrative SSH session open while testing, so a configuration mistake does not lock you out.
Diagnose a console/SSH mismatch
- Message appears on the console but not through SSH: check
/etc/pam.d/sshd, the effectivePrintMotdvalue, and any SSH-specific conditional rules. - Message appears through SSH but not on the console: inspect
/etc/pam.d/loginand the console login program’s PAM includes. - Message appears twice: look for more than one
pam_motd.soline or a combination of daemon-level printing and PAM printing. - Only generated content is missing: run the update scripts manually and check that each intended fragment is executable and has an accepted filename.
Static versus generated MOTD: choose deliberately
| Approach | Ownership | Survives package changes | Login cost | Ordering and precedence | Typical coverage |
|---|---|---|---|---|---|
/etc/motd static file |
One local text file | Usually stable, unless a distribution regenerates or replaces it | Minimal; no script execution | No internal fragment ordering | Any session whose PAM stack reads the file |
motd.d fragments |
Multiple local and vendor files | Local /etc entries override same-named lower-precedence entries |
Reading several files | Lexicographic order; directory precedence applies | Any session using the corresponding pam_motd paths |
update-motd.d scripts |
Executable scripts assembled at login | Local scripts normally remain separate from packaged scripts, but generated output is rebuilt | Every script runs at each login | run-parts --lsbsysinit filename rules and numeric/alphabetical order |
Ubuntu/Debian configurations that enable the framework |
The dynamic framework is not a universal Linux standard. Debian’s documentation describes it as a Debian- and Ubuntu-specific patch that may not exist in other GNU/Linux distributions and is not part of upstream PAM. On another distribution, expect a static /etc/motd, motd.d fragments, vendor login tooling, or a different PAM arrangement. Inspect the local files before copying Ubuntu instructions.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Security, privacy, and operational guidelines
Show only information users should see
A MOTD is visible to every successful login, including accounts that should not receive internal infrastructure details. Avoid exposing private IP addresses, cloud metadata, mount paths containing usernames, software versions that reveal unpatched systems, or the output of commands that may contain credentials.
Use least-privilege file permissions
Keep administrator-owned scripts and fragments writable only by root. A writable MOTD script is a root-execution path on the next login. Review ownership and mode after creating a file:
sudo find /etc/update-motd.d /etc/motd.d -maxdepth 1 -type f -printf '%M %u:%g %pn' 2>/dev/null
Do not treat a MOTD as an access-control banner
A message can communicate authorization policy, but it does not enforce it. Use SSH authentication, PAM access controls, firewall rules, and auditing for enforcement. If legal wording is required, have the system owner approve the exact text and make sure it is displayed on every relevant login path.
Troubleshoot changes that do not appear
The file was edited, but nothing changed
- Check whether
/etc/motdis a symlink and identify its target. - Confirm that the relevant PAM service contains, directly or through an include,
pam_motd.so. - For SSH, inspect the effective
PrintMotdsetting withsshd -T. - Open a new login session; an existing shell does not replay the MOTD.
- Read the file or run the generator manually to verify that the expected text exists before PAM displays it.
A dynamic script is skipped
- Make sure the file is executable:
sudo chmod 755 /etc/update-motd.d/90-custom. - Remove an extension such as
.shif it violates the localrun-partsfilename rules. - Check that the first line names an installed interpreter, for example
#!/bin/sh. - Run
sudo run-parts --lsbsysinit /etc/update-motd.dand correct syntax or command errors. - Ensure the script writes to standard output rather than a file that PAM never reads.
The output is duplicated or malformed
Search all active PAM includes for multiple MOTD modules, then check whether the SSH daemon is also printing a file. Ensure each fragment ends with a newline and that scripts do not emit debugging text, shell warnings, or control sequences unintentionally. A message that exceeds the documented 64 KB limit should be split into smaller, purposeful fragments rather than expanded indefinitely.
The message is stale
If a generated value does not update, determine whether the script is actually run at login and whether it reads a cached file. If the cache is maintained by a timer or another job, troubleshoot that producer separately. Do not add a network lookup to the login path merely to obtain fresher data; the resulting delay or outage can affect every login.
A practical rollout checklist
- Decide whether the message is static, a fragment, or generated.
- Inspect
/etc/motd, themotd.ddirectories, and/etc/update-motd.d. - Inspect PAM rules for both
loginandsshdwhen both access paths matter. - For SSH, record the effective
PrintMotdvalue before changing it. - Use a numbered, extension-free executable for an Ubuntu/Debian dynamic fragment.
- Preview generated output locally before opening a new session.
- Review permissions and remove sensitive data from the text and scripts.
- Test a fresh console login and a fresh SSH login, keeping an existing administrative session available.
- Document any local override in
/etc/motd.dso a future package update does not make its purpose mysterious.
Recommended patterns for common needs
One unchanging policy notice
Use a root-owned /etc/motd file if your PAM configuration reads it directly. Keep it short, plain text, and free of operational details that become obsolete quickly.
Free tools Windows power users keep installed
One-click scans. No signup required.
A hostname and kernel line on Ubuntu
Use an executable fragment such as /etc/update-motd.d/90-custom with hostname and uname -r. This keeps the message current without editing a generated file by hand.
Disable one vendor announcement
Find the exact filename in the lower-precedence motd.d directory and create a same-named /etc/motd.d symlink to /dev/null. This leaves package files intact while making the local preference explicit.
Show different information on console and SSH
Use separate PAM service configurations only when the distinction is necessary and documented. Verify both paths after changes; a file edit alone cannot override a PAM stack that never invokes the MOTD module.
Bottom line
Find the component that actually produces your login text before editing it. Use /etc/motd for a genuinely static message, /etc/motd.d for ordered local overrides and fragments, and executable /etc/update-motd.d scripts on Ubuntu or Debian when the content must be generated. Then verify the PAM service and SSH daemon settings separately, because MOTD behavior can differ between console and SSH sessions.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesQuick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

