Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

On Debian and Ubuntu, SSH authentication events usually go to /var/log/auth.log. On RHEL, Rocky, AlmaLinux and Fedora, check /var/log/secure. If the server uses only systemd-journald, query journalctl -u ssh or journalctl -u sshd; the correct unit name varies by distribution. A missing text file usually means rsyslog is not installed or active, not that OpenSSH has stopped logging.

Quick path by distribution and logging backend

The SSH daemon does not choose one universal filename. OpenSSH sends authentication messages to the system logging facility configured in sshd_config; rsyslog or journald then stores and routes those messages. Use this table as the fastest starting point.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Environment First place to check Example command
Debian or Ubuntu with rsyslog /var/log/auth.log sudo grep sshd /var/log/auth.log
RHEL, Rocky, AlmaLinux or Fedora with rsyslog /var/log/secure sudo grep sshd /var/log/secure
Systemd journal The ssh or sshd service unit sudo journalctl -u ssh --since today or sudo journalctl -u sshd --since today
Systems running auditd /var/log/audit/audit.log for audit records sudo ausearch -m USER_LOGIN

These locations can contain overlapping records. A server may write the same SSH event to a text file and the journal, while auditd records a separate security event with different fields.

Where are SSH login attempts logged on Ubuntu?

Check /var/log/auth.log

On a typical Ubuntu installation that uses rsyslog, SSH login attempts are in /var/log/auth.log. Debian systems use the same conventional path. Read the most recent entries with:

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • 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: 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.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
sudo grep -E 'sshd|ssh' /var/log/auth.log | tail -n 50

Search specifically for failed password authentication:

sudo grep 'Failed password' /var/log/auth.log

Successful authentications normally contain the word Accepted and identify the method, account, source address and SSH process:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo grep 'Accepted' /var/log/auth.log

Use sudo because authentication logs are normally readable only by root or members of an administrative log-reading group. An entry may show a connection attempt, a key exchange, a rejected account, a failed password, or a successful public-key login; not every line represents a completed login.

What is the SSH log file in CentOS or RHEL?

Check /var/log/secure

RHEL-family distributions, including RHEL, Rocky Linux, AlmaLinux and Fedora, conventionally route authentication messages to /var/log/secure when rsyslog is configured. Query it with:

sudo grep -E 'sshd|ssh' /var/log/secure | tail -n 50

The same patterns work for failed and successful attempts:

sudo grep 'Failed password' /var/log/secure
sudo grep 'Accepted' /var/log/secure

Do not assume that every Fedora or RHEL-derived image has this file. Minimal cloud images and newer installations may rely on journald alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • 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

How to use journalctl to see SSH logins

Try both service-unit names

On a systemd host, the journal is the authoritative local store when no text file is being maintained. Different distributions name the OpenSSH service differently, so try both units:

sudo journalctl -u ssh --since today
sudo journalctl -u sshd --since today

If one command reports that the unit does not exist, run the other. To inspect the service name installed on the machine, use:

systemctl list-units --type=service | grep -E 'ssh|sshd'

Useful journal filters

  • sudo journalctl -u ssh -f follows new events as they arrive; replace ssh with sshd when required.
  • sudo journalctl -u ssh --since '2 hours ago' limits output to a recent period.
  • sudo journalctl -u ssh --since '2026-10-01' --until '2026-10-02' searches an explicit time window; adjust the dates to your case.
  • sudo journalctl -u ssh -b restricts results to the current boot.
  • sudo journalctl -u ssh -o short-iso uses an unambiguous timestamp format that is easier to export or compare.

If the unit query returns nothing, search the entire journal for the daemon name:

sudo journalctl --since today | grep -E 'sshd|ssh'

That broader search can find messages emitted under a different unit or facility, but it may also include unrelated SSH client activity.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why is /var/log/auth.log missing?

The logging backend controls the filename

The expected path is determined by the logging stack, not by OpenSSH alone. OpenSSH emits messages using the LogLevel and SyslogFacility settings in sshd_config. Rsyslog reads those messages and applies routing rules that commonly create auth.log or secure. If rsyslog is absent or stopped, journald may be the only local record.

Fresh Debian 12 installations no longer install rsyslog by default, according to Linux Forensics. Fedora stopped installing it by default in Fedora 20. Upgraded machines can still have rsyslog because an earlier installation retained it. Therefore, a missing file on a current image is not, by itself, evidence of a logging failure.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【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.

Check which services and files exist

systemctl is-active systemd-journald
systemctl is-active rsyslog
ls -l /var/log/auth.log /var/log/secure 2>/dev/null
  • active journald and inactive or absent rsyslog: use journalctl.
  • Active rsyslog but no expected file: inspect rsyslog rules, permissions, rotation state and the facility selected by sshd_config.
  • No records in either backend: confirm that the SSH daemon is running and that its configuration passes validation before changing logging settings.

Do not create an empty auth.log or secure file as a workaround. A filename alone does not make OpenSSH or rsyslog write to it.

How to identify failed and successful SSH events

Common text-log patterns

These searches are useful starting points, but wording can vary with OpenSSH and distribution versions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Failed password indicates a password authentication failure.
  • Accepted password indicates a successful password authentication.
  • Accepted publickey indicates a successful key-based authentication.
  • Invalid user identifies an attempt against an account name the server does not recognize.
  • authentication failure may appear in records generated by the broader authentication framework rather than directly by sshd.

Combine a pattern with a time or source-address filter when investigating a noisy server. For example:

sudo grep 'Failed password' /var/log/auth.log | grep '203.0.113.25'
sudo journalctl -u sshd --since '2026-10-15 08:00' | grep -E 'Failed password|Accepted'

Use the actual address and dates relevant to your incident. The examples use documentation address space and the current date only as formatting examples.

Retention, rotation and older boots

Text files may have rotated

Rsyslog-managed files are commonly rotated. Older records may therefore be in files with suffixes such as .1 or compressed archives. List the directory before concluding that history is absent:

sudo ls -lh /var/log/auth.log* /var/log/secure* 2>/dev/null

Search a compressed rotation with the appropriate decompression-aware tool, for example zgrep, rather than reading only the current file. Retention periods and rotation rules are local policy decisions; there is no universal number of days for either distribution family.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【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.

The journal has its own retention policy

Check how much space the journal uses and which boots are still available:

sudo journalctl --disk-usage
sudo journalctl --list-boots

Use the boot identifier shown by --list-boots to investigate an earlier startup:

sudo journalctl -b -1 -u sshd

Replace sshd with ssh when that is the installed unit. Volatile journals may disappear at reboot, and persistent journals may be limited by disk quotas or retention settings. Treat the absence of an old entry as an evidence limitation, not proof that the event never happened.

What SSH logs do—and do not—prove

Authentication evidence

The SSH log is primarily an authentication and connection record. It can show when sshd accepted or rejected credentials, which account was named, the authentication method and often the remote address. It does not automatically provide a complete record of every command run after login.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Related records answer different questions

  • last reads the wtmp login database and summarizes recorded sessions.
  • lastb reads btmp failed-login records when that database is enabled and readable.
  • Shell history files can show commands, but users or malware can alter, disable or delete them, and history is not a complete audit trail.
  • /var/log/audit/audit.log, queried with ausearch, can contain auditd events such as USER_LOGIN and process activity when auditd is installed and configured.

For an investigation, compare accepted or failed SSH entries with last, lastb, journal records and auditd data instead of treating one source as exhaustive.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Inspecting and changing SSH logging controls

Review the daemon configuration safely

OpenSSH reads logging directives from its server configuration, usually /etc/ssh/sshd_config and any included files. Find active settings with:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【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.
sudo grep -R -E '^[[:space:]]*(LogLevel|SyslogFacility)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d 2>/dev/null

LogLevel controls how much detail sshd emits. SyslogFacility selects the facility that the system logger routes. Rsyslog rules must match that facility for records to reach a particular text file. A custom facility or rule can therefore produce a valid log in an unexpected location.

Validate before restarting

After any configuration change, validate the syntax before applying it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo sshd -t

Only a successful validation should be followed by the service manager operation appropriate to your distribution. Keep an existing administrative session open while testing a change so a mistake does not lock you out.

A practical investigation workflow

  1. Identify the platform. Confirm whether it is Debian/Ubuntu, a RHEL-family distribution or another systemd-based environment.
  2. Check the conventional text path. Look in /var/log/auth.log or /var/log/secure, including rotated files.
  3. Query both common journal units. Run journalctl -u ssh and journalctl -u sshd with a time range.
  4. Determine the backend. Check systemd-journald, rsyslog and the existence of the files.
  5. Read the daemon’s routing settings. Review LogLevel, SyslogFacility and rsyslog rules if records are unexpectedly routed.
  6. Correlate evidence. Compare SSH records with last, lastb and auditd when the question involves sessions or post-login activity.
  7. Preserve what matters. Export relevant journal entries and copy rotated files before retention or rotation removes them.

When local logs are not enough

Local logs can be rotated, lost with an ephemeral instance, altered by a privileged attacker or limited by the journal’s retention policy. Higher-risk systems should forward authentication and audit events to a central collector with controlled access and its own retention policy. Central collection does not replace checking the local journal: it gives investigators another copy and helps correlate activity across servers.

For routine administration, the key distinction is simple: use the conventional text file when rsyslog maintains one, and use the systemd journal when it does not. For security investigations, treat both as sources of authentication evidence rather than a complete transcript of user activity.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.