简体   繁体   English

我可以在Linux系统上审核用户的活动,当用户登录,使用SSH身份共享用户?

[英]Can I audit user activity on a linux system when users login as a shared user using an ssh identity?

Let's say I have a user "appuser" on a linux system with a number of public keys set up in their authorized_keys file where several different people can log in as "appuser". 假设我在Linux系统上有一个用户“ appuser”,并在他们的authored_keys文件中设置了许多公钥,几个不同的人可以以“ appuser”身份登录。

When I log in using my private key that is linked to my public key, is what I do as the "appuser" traceable back to me? 当我使用链接到公钥的私钥登录时,作为“ appuser”可以追溯到我做什么? (I want it to be). (我希望是)。 If the activity is not traceable back to the identity of the user that logged in as app user, is there a way to make it traceable back to that identity? 如果活动不可追溯到以应用程序用户身份登录的用户的身份,是否有办法使其可追溯到该身份?

The authorized_keys file allows for some options, including 'command' which will call a program or script you can write. authorized_keys文件允许使用某些选项,包括“命令”,该命令将调用您可以编写的程序或脚本。 I haven't tried this, but you might be able to perform whatever actions you need to in the script and then exec bash (or your shell of choice). 我没有尝试过,但是您可以执行脚本中需要执行的任何操作,然后执行bash(或您选择的shell)。

Another way you can match logins with keys is to turn LogLevel in sshd_config to VERBOSE and grep /var/log/secure (or whatever AUTHPRIV messages are going to) for 'Found matching .* key'. 您可以使用键来匹配登录名的另一种方法是将sshd_config中的LogLevel转换为VERBOSE,然后将grep / var / log / secure(或任何AUTHPRIV消息发送给)以用于“找到匹配的。*键”。 You can run the key found in the 'Found matching' line through 'ssh-keygen -l -f' which will dump the matching entry in authorized_keys. 您可以通过“ ssh-keygen -l -f”运行在“找到的匹配项”行中找到的密钥,这会将匹配项转储到authorized_keys中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Linux:如何使用 Apache 用户连接 SSH? - Linux: How can I SSH connect using Apache user? 如何在Linux中使用ruby和net / ssh切换用户? - How do I switch user in Linux using ruby and net/ssh? 我在用户登录时发送系统通知时遇到问题 (KDE Plasma) (Arch Linux) - I'm having problems sending a system notification upon user login (KDE Plasma) (Arch Linux) 如何在 Linux 中添加具有不同 SSH 密钥的用户? - How can I add users with different SSH keys in Linux? 无密码ssh-login后检查远程用户的身份? - Check identity of remote-user after password-less ssh-login? 如何使用Python在Linux服务器中自动创建用户 - How can I automate the user creation in Linux servers using Python 如何在Linux上使用C执行过程中切换用户 - How can I switch user during execution using C on Linux 如何计算用户使用linux bash命令分组的用户会话? - How can i count user sessions grouped by users with linux bash command? 如何在Linux上定义要求用户使用注册设备登录的其他安全级别? - How can I define other level of security on linux that requires users to login using a registered device? sharedUserId 在运行系统应用程序时给出共享用户不兼容的错误 - sharedUserId gives shared user incompatible error when running a system application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM