Results 1 to 6 of 6

Thread: View incoming ssh and sftp connections

  1. #1
    Join Date
    Apr 2006
    Location
    NH/VT
    Beans
    22
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    View incoming ssh and sftp connections

    Sorry in advance if this is posted elsewhere, I did numerous searches and couldn't find anything relevant. Also checked manpages for answers and found nothing.

    I'm running an openssh server on my Ubuntu 8.04 machine. (just for easy access to my files elsewhere). Is there an easy way to view all currently active ssh/sftp connections? I would like to see who's logged on, and if possible details about their actions.

    Thank you.

  2. #2
    Join Date
    Oct 2007
    Location
    ISS
    Beans
    1,429

    Re: View incoming ssh and sftp connections

    Quote Originally Posted by futileissue View Post
    Sorry in advance if this is posted elsewhere, I did numerous searches and couldn't find anything relevant. Also checked manpages for answers and found nothing.

    I'm running an openssh server on my Ubuntu 8.04 machine. (just for easy access to my files elsewhere). Is there an easy way to view all currently active ssh/sftp connections? I would like to see who's logged on, and if possible details about their actions.

    Thank you.
    See /var/log/auth.log and try the command "netstat". Read

    Code:
    man netstat
    These will show you login attempts and active connections. I don't know how you can log their actions.

  3. #3
    Join Date
    Apr 2006
    Location
    NH/VT
    Beans
    22
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: View incoming ssh and sftp connections

    Thanks. I think after some research I've discovered that sftp with openssh simply does not support any realistic way to accurately log actions.

  4. #4
    Join Date
    Jul 2007
    Location
    Keighley - UK
    Beans
    62
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: View incoming ssh and sftp connections

    you can try "watch who" in a terminal, which will show you who is logged in (from where, IP etc, or if they're local with their tty) it updates every 2 seconds, I use it to keep SSH alive (SSH keepalive doesn't work against corporate firewall used here)

  5. #5
    Join Date
    Dec 2009
    Beans
    5

    Re: View incoming ssh and sftp connections

    Try -

    grep sshd:session /var/log/auth.log | tail -1 | awk '{print $8}'

    Will return "opened" or "closed" or nothing if no sessions ever used.

  6. #6
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 14.10 Utopic Unicorn

    Re: View incoming ssh and sftp connections

    Old thread closed, please don't bump old threads.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •