Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I hope I am overlooking something obvious. I am not looking for information about malicious hacking. Just normal monitoring.
When connecting directly through SSH, the shell history reveals the user's commands. Not so with SSHFS. Files can be changed through SSHFS and the shell history is never touched.
The /var/log/secure (audit.log) shows who connected but not any activity.
Since sshfs provides a local mount of a remote file system, wouldn't any activity be reflected in the local history/logs?
I woudn't expect the remote system to know anything about activity, although of course a change (add/remove/edit) of a file on the local system would be visible (but not logged) on the remote system.
wouldn't any activity be reflected in the local history/logs
Possibly, but access to that history or logs is unlikely if personal systems are used for the access. That in itself is a different security topic for another day.
At the moment, looks like I might have to learn about the built-in kernel auditing.
When connecting directly through SSH, the shell history reveals the user's commands. Not so with SSHFS. Files can be changed through SSHFS and the shell history is never touched.
Let me point out that the user has full control of the Bash history and can switch it off. Or use a shell that doesn’t have a history mechanism.
Let me point out that the user has full control of the Bash history and can switch it off. Or use a shell that doesn’t have a history mechanism.
Yes, I know. Thankfully that is not an issue though.
Quote:
I think you want an intrusion detection system.
Possibly, but probably not. I already know who is logged in, when, and from what IP address. I just can't tell what was changed when SSHFS is used rather than direct SSH login. And yes, sometimes "who" logged in through SSHFS is me.
Quote:
Alternatively, you could audit exec and open system calls.
sshfs is the fuse file system for sftp which is a subsystem of ssh. You need to enable sftp log level in your server's sshd_config file. I believe the logs will be in the system log file which depends on the distribution.
sshfs is the fuse file system for sftp which is a subsystem of ssh. You need to enable sftp log level in your server's sshd_config file. I believe the logs will be in the system log file which depends on the distribution.
this.
also fuse can probably be tweaked somehow to output informational messages.
lastly sshfs has some options of its own too.
another of these questions that wouldn't have been asked if OP had done their research, or at the very least RTFM (read the fruitful manual).
If you do a lot of logging, you can make a separate log file by giving the SFTP activity a different log facility, e.g. LOCAL2, instead of the default of AUTH.
Funny how priority lists get changed. I finally was able to get back to this task.
Thanks much for the friendly nudging about SSHFS being a FUSE subsystem and being related to SFTP. For the moment I am using INFO logging details on a test system. I decided to dump the output to the SSH authentication log. Working fine, although I had to tweak rsyslog.conf. Oddly, authpriv.* was defined but not auth.*, which I added.
In summary,
* Edit /etc/ssh/sshd_config:
Code:
Subsystem sftp /usr/libexec/openssh/sftp-server -l info -f auth
* Edit /etc/rsyslog.conf:
Code:
authpriv.* /var/log/secure
auth.* /var/log/secure
I'll tag this topic as solved.
Quote:
another of these questions that wouldn't have been asked if OP had done their research, or at the very least RTFM (read the fruitful manual).
Pompous and not constructive. Sometimes people need some friendly nudging.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.