컴퓨터 로그인을 어느 방법으로 했는지 알 수 있는게 있을까요?

ljs0652의 이미지

제목이 좀 이상하긴한데

일반적으로 로그인을 한건지, 아니면 원격접속을 통해 로그인을 한건지 알 수 있는 방법이 있을까요?

이벤트로그 알아봤는데 구분이 ip 유무 인거 같아서 좀 더 확실한게 있는지 궁금합니다

ymir의 이미지

일반적으로 로그인을 했다는게 무엇을 의미하시는지 알기 어렵네요.
현재 로그인 해 있는 사용자는 w 나 who 명령으로 확인 가능합니다.
TTY 가 tty 나 console 로 나오는 경우는 콘솔에서 로그인한 경우이고..
remote 에서 로그인한 경우에는 pts 가 할당되고, remote ip 가 표시됩니다.

$ w
 16:27:32 up 28 min,  2 users,  load average: 0.00, 0.02, 0.05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
ymir     tty1     -                16:26    1:06   0.07s  0.05s -bash
ymir     pts/0    192.168.1.200    15:58    3.00s  0.30s  0.00s w
$ who
ymir     tty1         2019-02-20 16:26
ymir     pts/0        2019-02-20 15:58 (192.168.1.200)

이전의 로그인 이력은 last 명령으로 확인할 수 있습니다.

되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』

ljs0652의 이미지

제가 만약에 a라는 계정으로 로그인을 했다면, 일반적으로 그냥 컴퓨터로 로그인을 하는 방법과, 원격으로 다른 pc에서 로그인을 하는 방법 두가지가 있다고 했을때, pc 로그나, 프로그래밍적으로 이를 구분해 줄 수 있는 방법이 있을까 하는게 질문입니다. 기존 이벤트 로그는 이력은 남지만 접속자의 ip를 통해서 로그인 방법을 유추할 수 있는데 이 말고 확실하게 원격접속을 했다는걸 알려줄 수 있는 방법이 있는지 궁금해서요

ymir의 이미지

위에서 언급했듯이 TTY 를 확인해 보시면 됩니다.
console 에서 로그인 한 경우에는 tty 가 할당되고..
remote 에서 로그인 한 경우에는 pts (pseudo terminal slave) 가 할당됩니다.

단, console 에서 로그인 했더라도, ssh 등을 이용해서 다시 로그인 한 경우에는 pts 가 할당됩니다.
(loopback 이던, local ip 든.. 네트워크를 통해 로그인 한 경우이기 때문에...)
이 경우에는 remote address 가 local host 의 ip 가 아닌지 체크할 필요가 있겠네요.

x-window 의 경우에는 tty 가 :0 와 같이 뜨는데..
x-manager 같은 걸 이용해서 remote 에서 접속한 경우에는, 추가로 IP 가 붙었던 걸로 기억됩니다. (확인 필요)

https://unix.stackexchange.com/questions/335992/what-is-the-difference-between-pts-and-tty-and-0

되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.