mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-24 23:15:39 +00:00
SFTP: adding SFTP Servver logging
This commit is contained in:
parent
e26f238f26
commit
cb6222c7e3
|
@ -3,6 +3,9 @@
|
||||||
port=22
|
port=22
|
||||||
ip=$(hostname -I | awk '{print $1}')
|
ip=$(hostname -I | awk '{print $1}')
|
||||||
|
|
||||||
|
# Set the log file path
|
||||||
|
log_file="$rdhome/.logs/sftp_server.log"
|
||||||
|
|
||||||
# Check if the port is in use
|
# Check if the port is in use
|
||||||
if nc -z localhost $port; then
|
if nc -z localhost $port; then
|
||||||
zenity --error --no-wrap \
|
zenity --error --no-wrap \
|
||||||
|
@ -19,6 +22,9 @@ echo "retrodeck:$(openssl passwd -1 retrodeck)" >> /tmp/sftp_home/retrodeck/etc/
|
||||||
# Set rdhome as the home directory for retrodeck user
|
# Set rdhome as the home directory for retrodeck user
|
||||||
echo "Match User retrodeck\n ChrootDirectory $rdhome" >> /etc/ssh/sshd_config
|
echo "Match User retrodeck\n ChrootDirectory $rdhome" >> /etc/ssh/sshd_config
|
||||||
|
|
||||||
|
# Redirect SSHD logs to the specified log file
|
||||||
|
echo "Match User retrodeck\n ChrootDirectory $rdhome\n ForceCommand internal-sftp -l INFO -f $log_file" >> /etc/ssh/sshd_config
|
||||||
|
|
||||||
# Restart SSHD to apply the new configuration
|
# Restart SSHD to apply the new configuration
|
||||||
service ssh restart
|
service ssh restart
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue