Create ssh_shell

This commit is contained in:
Morgan 2023-12-01 16:00:18 +09:00 committed by GitHub
parent 60ec3df42e
commit 7399b93ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

10
scripts/ssh_shell Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
#
TIME="$(TZ='Asia/Seoul' date +%Y-%m-%d_%H-%M)"
CLIENT_IP=$(echo $SSH_CLIENT | awk '{print $1}')
echo remote: You are connected to SSH Shell from $CLIENT_IP.
echo [$TIME] Client: "$CLIENT_IP", Argument: "$SSH_ORIGINAL_COMMAND" >> ssh_log
ssh -p $INT_PORT user@$INT_HOST $SSH_ORIGINAL_COMMAND