DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st March 2009
amscotti's Avatar
amscotti amscotti is offline
Real Name: Anthony Scotti
Port Guard
 
Join Date: Nov 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default List of users connected by sftp.

Hi,

I been playing around with OpenBSD 4.4 for abit now but still trying to learn somethings. Its sounds like should be easy but I just can't seem to find any help on Google. Maybe I'm just not looking for the right thing.

Right now, I have setup a users for sftp only that are chroot to there home folder. Everything is working fine with the chroot/sftp but I'm just not sure how to tell if there are users on the system connected by sftp.

who and w only show myself on the system. Is there a other way to tell?

Thanks for the help!
Reply With Quote
  #2   (View Single Post)  
Old 31st March 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,815
Thanked 214 Times in 189 Posts
Default

I can't do any testing right now; but I think that sftp can be logged if you set up the appropriate subsystem. See the sftp-server(8) man page, and the Subsystem discussion in sshd_config(5).
Reply With Quote
  #3   (View Single Post)  
Old 1st April 2009
amscotti's Avatar
amscotti amscotti is offline
Real Name: Anthony Scotti
Port Guard
 
Join Date: Nov 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default

Thanks for the reply jggimi,

I'm using the "internal-sftp" subsystem in my sshd_config file. So, from the sftp-server(8) man page I would want to add a -f AUTH -l ERROR to start logging, Right?

Full line would read,
Code:
Subsystem       sftp    internal-sftp -f AUTH -l ERROR
Thanks for the help
Reply With Quote
  #4   (View Single Post)  
Old 1st April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,815
Thanked 214 Times in 189 Posts
Default

I do not know if the internal-sftp feature can log or not. From my interpretation of the man page, these syslog options are only usable with sftp-server.
Reply With Quote
  #5   (View Single Post)  
Old 1st April 2009
amscotti's Avatar
amscotti amscotti is offline
Real Name: Anthony Scotti
Port Guard
 
Join Date: Nov 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default

I changed the line in my sshd_config file and added -f AUTH -l ERROR. Restarted the sshd and now it seem to be logging to my /var/log/authlog file which is very great!

Thanks jggimi!

Also, Is there be a way to run a command to show the uses log on? like something I could run before shutting down or restarting the computer?

Thanks for the help!
Reply With Quote
  #6   (View Single Post)  
Old 1st April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,815
Thanked 214 Times in 189 Posts
Default

I think you asked the same question in your first post.

I'm not aware of any such command in the OS, nor, am I aware of one in the ports/package system. I would think that if sftp-server or internal-sftp used utmp/wtmp, the standard user tools like w(1) could be used.
Reply With Quote
  #7   (View Single Post)  
Old 1st April 2009
amscotti's Avatar
amscotti amscotti is offline
Real Name: Anthony Scotti
Port Guard
 
Join Date: Nov 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
I think you asked the same question in your first post.
Yup, you are right. Logging was going to be the next thing I asked tho.

Quote:
Originally Posted by jggimi View Post
I'm not aware of any such command in the OS, nor, am I aware of one in the ports/package system. I would think that if sftp-server or internal-sftp used utmp/wtmp, the standard user tools like w(1) could be used.
I'll look in to utmp/wtmp.

Thanks for all the help jggimi!
Reply With Quote
  #8   (View Single Post)  
Old 1st April 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Connections via sftp aren't considered interactive logins, thus.. are not registered via utmp(5)/wmtp.

While you're free to look at the relevant man pages amscotti, they are a programming API.. not programs.

Sorry, but it's still easy to determine active connections with a little more.. work.

$ fstat | grep internet | grep "<--" | grep "sshd" | grep -v "root" | cut -d ' ' -f 1

It's a little primitive, but.. it'll get the job done.
Reply With Quote
Reply

Tags
sftp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buy/Sell/Free Hardware List DrJ Off-Topic 24 23rd March 2014 07:20 PM
PHP~MYSQL - Get list of all the fields within a table cksraj Programming 2 22nd April 2009 05:57 AM
SATA connected CD/DVD drives, any experience? teig FreeBSD General 13 6th December 2008 01:35 AM
How to get a list of volumes? PeterSteele Programming 12 17th July 2008 09:32 AM
Command to list all installed ports? windependence FreeBSD Ports and Packages 2 13th May 2008 11:10 AM


All times are GMT. The time now is 12:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick