kingToolbox / kingToolbox/WindTerm

Command in /etc/ssh/sshrc repeat running after login SSH

Open
#1,488 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
32.3k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Put some command to /etc/ssh/sshrc like:
```
#!/bin/bash

mail=user@domain.tld
monitored_user=root
monitored_ip=x.x.x.x

hostname=$(hostname)

# add a welcome message:
printf >&2 "\nWelcome on $hostname $USER\n"

read -d " " ip <<< $SSH_CONNECTION

[[ $ip == $monitored_ip && $USER == $monitored_user ]] || exit 0

date=$(date "+%d.%m.%Y %Hh%M")
reverse=$(dig -x $ip +short)

mail -s "Connexion of $USER on $hostname" $mail <

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the report with the shown command in /etc/ssh/sshrc and an SSH login, recording how many times it runs. Compare that behavior with the expected single execution per login and investigate the SSH login path; done means the command no longer repeats after one login.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.