Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk9 min

Where to Find the SSH Log File on a Linux Server

A practical guide to locating SSH authentication logs on Debian, Ubuntu, RHEL, Rocky, AlmaLinux, and Fedora, including journalctl commands, missing-file troubleshooting, rotation, and auditd context.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On Debian and Ubuntu, check /var/log/auth.log. On RHEL, Rocky, AlmaLinux, and Fedora, check /var/log/secure. On a systemd host, the authoritative record may exist only in the journal, which you query with journalctl -u ssh or journalctl -u sshd. The service unit and available text file depend on the distribution and logging stack.

Use sudo for these commands: authentication logs are normally readable only by root or members of a privileged group.

As an Amazon Associate I earn from qualifying purchases.

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

SSH log locations by Linux distribution

OpenSSH sends authentication messages to the host’s logging system; it does not guarantee one universal file path. Traditional rsyslog rules write those messages to distribution-specific files, while systemd-journald keeps them in a binary journal that is searched with journalctl. A machine can have both copies, or only the journal.

Environment Logging backend First place to check Example query
Debian or Ubuntu with rsyslog rsyslog text files /var/log/auth.log sudo grep sshd /var/log/auth.log
RHEL, Rocky, AlmaLinux, or Fedora with rsyslog rsyslog text files /var/log/secure sudo grep sshd /var/log/secure
Any systemd-based distribution systemd-journald Journal entries for the ssh or sshd unit sudo journalctl -u ssh --since today or sudo journalctl -u sshd --since today
Host running auditd Linux audit subsystem /var/log/audit/audit.log sudo ausearch -m USER_LOGIN

The text files and journal can contain overlapping authentication events. Audit records, login databases, and shell history answer different questions and should not be treated as interchangeable SSH logs.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Where are SSH login attempts logged on Ubuntu?

Read the current text log

On a conventional Ubuntu or Debian installation with rsyslog enabled, /var/log/auth.log is the normal file for SSH authentication messages. To display the newest 50 SSH-related lines:

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

To isolate rejected password attempts, search for the daemon’s standard message:

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

Successful public-key, password, or other accepted sessions normally contain Accepted:

sudo grep 'Accepted' /var/log/auth.log

Use the file’s rotated copies when investigating an older date. Names commonly include auth.log.1 and compressed files such as auth.log.2.gz; list the directory before searching so you know which periods are available:

sudo ls -lh /var/log/auth.log*

For compressed rotations, use zgrep, for example:

sudo zgrep -E 'Failed password|Accepted' /var/log/auth.log.2.gz

Ubuntu systems with no auth.log

A fresh Debian 12 installation may not install rsyslog by default. If rsyslog is absent or inactive, the journal can be the only local record even though SSH logging is working normally. Do not create an empty file and assume it is collecting events; check the journal and service state first.

What is the SSH log file in CentOS, RHEL, Rocky, AlmaLinux, or Fedora?

Read /var/log/secure

RHEL-family systems traditionally route authentication and authorization messages to /var/log/secure. This includes RHEL, CentOS-derived systems such as Rocky and AlmaLinux, and Fedora installations that retain rsyslog. Query recent SSH lines with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo grep -E 'sshd|ssh' /var/log/secure | tail -n 50

Search for failed and accepted sessions in the same way:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo grep 'Failed password' /var/log/secure
sudo grep 'Accepted' /var/log/secure

Check rotated files before concluding that an event never occurred:

sudo ls -lh /var/log/secure*

Fedora stopped installing rsyslog by default in Fedora 20. Upgraded machines may still have it, while newer or minimally installed systems may retain only journald. Therefore, a missing /var/log/secure is often a backend choice rather than evidence that sshd generated no messages.

How to use journalctl to see SSH logins

Try both common unit names

Systemd distributions name the OpenSSH service differently. Run both commands if you do not know the unit name:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo journalctl -u ssh --since today
sudo journalctl -u sshd --since today

An error saying a unit does not exist does not prove that SSH is uninstalled; it may simply use the other name. Discover the installed service with:

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

Once you identify the unit, add useful journal filters:

# Last 24 hours, newest entries at the end
sudo journalctl -u sshd --since '24 hours ago' --no-pager

# Follow new events as they arrive
sudo journalctl -u sshd -f

# Show only messages containing authentication keywords
sudo journalctl -u sshd --since today | grep -E 'Failed|Accepted|Invalid|authentication'

If the distribution uses a socket or a service wrapper, filtering by process name can be useful when the unit filter returns nothing:

sudo journalctl _COMM=sshd --since today

Journal access is also controlled by permissions. A non-root user may see only a restricted subset or no system-wide entries; rerun the command with sudo when results look incomplete.

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.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Inspect older boots and retention

The journal may be volatile, persistent, or limited by local policy. Check how much space it uses and which boots are still retained:

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

To inspect an earlier boot, pass its index from --list-boots, such as:

sudo journalctl -b -1 -u sshd

Retention has no universal duration: image defaults, available disk space, explicit limits, and administrator policy determine whether an event from a previous week or reboot remains searchable.

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

Check whether journald and rsyslog are running

First establish which logging services exist and are active:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl is-active systemd-journald
systemctl is-active rsyslog
ls -l /var/log/auth.log /var/log/secure 2>/dev/null

systemd-journald is normally present on systemd hosts. If it is active and the journal query returns SSH messages, the absence of a text file is expected when rsyslog is not installed or enabled. If rsyslog is installed but inactive, its files may stop receiving new entries while journald continues to collect them.

Understand the distribution defaults

Debian 12 no longer installs rsyslog by default, and Fedora stopped doing so by default in Fedora 20. Cloud images, containers, hardened builds, and upgraded servers can therefore have different combinations of journald and rsyslog. Two servers running the same distribution name may expose different paths because one inherited an older configuration.

Verify that the SSH daemon is actually producing events

Check the daemon status and recent service messages:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
sudo systemctl status ssh
sudo systemctl status sshd
sudo journalctl -xe --since '15 minutes ago'

Only one of the two service names may exist. A failed service, a connection reaching a different host, or a firewall dropping traffic before it reaches sshd will produce a different diagnosis from a logging-routing problem.

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

What information appears in an SSH authentication log?

Failed attempts

Entries containing Failed password generally identify the account name supplied, the remote address, and the authentication method. Invalid user indicates that the requested account was not recognized. Repeated failures from one address can indicate password guessing, but an IP address alone does not establish who controlled the client or whether a successful compromise occurred.

Successful sessions

Accepted password, Accepted publickey, and similar messages show that an authentication method was accepted by sshd. Record the timestamp, account, source address, and method, then correlate the session with other host evidence before attributing activity to a person.

Connection and negotiation messages

Depending on the configured log level, the daemon may also report disconnects, protocol negotiation failures, refused keys, and account restrictions. A quiet log can therefore mean either no activity or a logging level that omits lower-priority details.

SSH authentication logs are not a complete activity record

An SSH log answers “what did the SSH daemon accept or reject?” It does not automatically show every command typed after login, files changed through a session, or actions performed through another service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • wtmp and last: Login accounting databases used to review recorded sessions and their duration. Run last to inspect normal login records.
  • btmp and lastb: Failed-login accounting, when enabled and retained. Access commonly requires root, for example sudo lastb.
  • Shell history: Files such as a user’s ~/.bash_history are user-controlled, may be disabled, and do not prove that every command ran successfully.
  • auditd: Optional kernel audit records in /var/log/audit/audit.log. Query login-related records with sudo ausearch -m USER_LOGIN; audit rules and retention determine what is available.

Compare accepted or failed SSH entries with last, lastb, journal records, and auditd data when present. Differences are useful clues: each subsystem has its own filters, clocks, rotation policy, and failure modes.

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

How OpenSSH and rsyslog decide where messages go

sshd_config controls what the daemon emits

OpenSSH exposes LogLevel and SyslogFacility in sshd_config, usually under /etc/ssh/sshd_config or an included configuration directory. LogLevel controls detail; SyslogFacility labels the messages for the logging system. A restrictive level can omit useful diagnostics, while an unnecessarily verbose level can increase noise and storage use.

Inspect the effective configuration rather than relying only on comments in the file:

sudo sshd -T | grep -E 'loglevel|syslogfacility'

After any configuration change, validate syntax before restarting:

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.
sudo sshd -t
sudo systemctl reload sshd

On Debian or Ubuntu, the service may be named ssh, so use sudo systemctl reload ssh when that is the installed unit. Keep an existing administrative session open while testing a reload or restart so a mistake does not lock you out.

rsyslog rules route facilities to files

rsyslog receives the facility-tagged messages and applies rules under locations such as /etc/rsyslog.conf and /etc/rsyslog.d/. Those rules are why one distribution writes authentication messages to auth.log and another writes them to secure. A local rule can redirect, duplicate, filter, or discard records.

When changing rsyslog rules, validate the configuration and reload the service according to the distribution’s procedure. Then generate a controlled test, such as one deliberate failed login from an approved administration address, and verify where the event appears. Avoid testing with repeated password guesses against a production account.

Rotation, retention, and centralized collection

Text logs are commonly rotated, renamed, compressed, and eventually deleted by a local policy. Journald can be volatile or persistent and can reclaim space according to size and time limits. Consequently, “the log file” is a moving set of records, not necessarily one file that contains the server’s entire history.

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

For a high-risk or internet-facing server, forward authentication events to a separate, access-controlled collector. Local attackers with root access can alter or delete local files, and an attacker who gains control of the host may also influence its journal and login databases. Central collection does not replace local verification, but it preserves a second copy with independent retention and access controls.

A practical troubleshooting sequence

  1. Identify the distribution and init system. Confirm whether the host is Debian/Ubuntu, RHEL-family, Fedora, or another systemd distribution.
  2. Try the conventional file. Use /var/log/auth.log on Debian/Ubuntu and /var/log/secure on RHEL-family systems.
  3. Query both journal unit names. Run journalctl -u ssh and journalctl -u sshd with a time range.
  4. Check services and file presence. Compare systemctl is-active systemd-journald, systemctl is-active rsyslog, and ls -l on the expected paths.
  5. Check rotated records and older boots. List wildcard text-log files and use journalctl --list-boots before declaring an event missing.
  6. Broaden the evidence. Consult last, lastb, and auditd only when the question requires session accounting or broader audit evidence.
  7. Preserve what you find. Export relevant journal entries and copy log files to controlled storage before they rotate or are overwritten.

Choosing the right source for the question

Question Best first source Important limitation
Did an SSH password or key attempt fail? /var/log/auth.log, /var/log/secure, or the SSH journal unit Retention and LogLevel may omit older or lower-detail events.
Was an SSH authentication accepted? Authentication text log or journalctl -u sshd/ssh An accepted login does not show what the user did afterward.
Which recorded users logged in and when? last and wtmp Login accounting is separate from daemon messages and can be incomplete.
Which failed logins were recorded by the accounting subsystem? lastb and btmp Requires the database to exist and be retained.
Which audited login events exist? ausearch -m USER_LOGIN against auditd data Audit rules, permissions, and rotation determine coverage.

The dependable starting rule is simple: use the distribution’s conventional file when rsyslog is present, use the SSH service’s journal when it is not, and treat auditd and login databases as complementary evidence rather than substitutes.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.