We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If accidentaly started by a logged-in user, forsh will log it as login attempt. It should detect this and just print help message.
The text was updated successfully, but these errors were encountered:
The approach might be to detect if SSH_CONNECTION environment variable is set and parent process of forsh is sshd.
SSH_CONNECTION
forsh
sshd
For FreeBSD, seems I need to use kvm_getargv90 to find the process name after the getppid(): https://www.freebsd.org/cgi/man.cgi?query=kvm_getprocs&sektion=3&n=1
kvm_getargv90
getppid()
For Linux, apparently, the only way is to read /proc directly.
/proc
Sorry, something went wrong.
Example of process tree of a program when run via ForceCommand:
ForceCommand
13437 - /usr/local/bin/get_ppid_and_name 13436 - sshd: sss@pts/5 13423 - sshd: sss [priv] 842 - /usr/sbin/sshd 1 - /sbin/init
Wonder, how to do it in a cross-platform way. Also, if run in chroot, /proc might not be available.
No branches or pull requests
If accidentaly started by a logged-in user, forsh will log it as login attempt. It should detect this and just print help message.
The text was updated successfully, but these errors were encountered: