0

What's the file in which the SSH logs are located in ubuntu server 22.04? FOR exp in centos "/var/log/secure"

morad della3
  • 21
  • 1
  • 5
  • /var/log/auth.log ? – Esther Sep 21 '22 at 21:09
  • Does this answer your question? [Where does Ubuntu 14.04 log SSH access attempts?](https://askubuntu.com/questions/640906/where-does-ubuntu-14-04-log-ssh-access-attempts) – Esther Sep 21 '22 at 21:12
  • 4
    Does this answer your question? [How do I keep track of failed SSH log-in attempts?](https://askubuntu.com/questions/178016/how-do-i-keep-track-of-failed-ssh-log-in-attempts) – Dan Sep 21 '22 at 21:14

1 Answers1

1

If you are looking for logs that show SSH connections, they are in

/var/log/auth.log

example:

Sep 20 17:39:52 [hostname] sshd[257027]: Accepted publickey for [username] from [ipaddress] port 57504 ssh2: RSA [alphanumeric-string]
Sep 20 17:39:52 [hostname] sshd[257027]: pam_unix(sshd:session): session opened for user [username] by (uid=0)
Sep 20 17:39:52 [hostname] sshd[257250]: Received disconnect from [ipaddress]  port 57504:11: disconnected by user
Sep 20 17:39:52 [hostname] sshd[257250]: Disconnected from user [username] [ipaddress]  port 57504
Sep 20 17:39:52 [hostname] sshd[257027]: pam_unix(sshd:session): session closed for user [username]
Organic Marble
  • 22,803
  • 12
  • 65
  • 118