reposync/scripts/ssh_shell

13 lines
397 B
Bash

#!/bin/bash
#
# no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,command="~/ssh_shell
#
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