commit 12939ed7be65b3a3e45a3f39566fac1a741128b2 Author: KYUNGMO TAK Date: Tue May 12 16:43:49 2026 +0900 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4e518b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# 20260512 tak created gitignore +.DS_Store diff --git a/create_sftp.sh b/create_sftp.sh new file mode 100644 index 0000000..50cab58 --- /dev/null +++ b/create_sftp.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#################################################################################################### +# # +# create SFTP, ver 1.0.0 05,April 2024 # +# # +# Copyright@2021 ATEC IoT Co.,Ltd All rights reserved # +# # +#################################################################################################### + +########################################### +# 1. Set sshd_config +########################################### + +sed -i '/^Subsystem\s\+sftp\s\+\/usr\/libexec\/sftp-server/d' /etc/ssh/sshd_config + +echo "Subsystem sftp internal-sftp" >> /etc/ssh/sshd_config +echo "Match Group cgeslsftp" >> /etc/ssh/sshd_config +echo " ChrootDirectory /sftp/" >> /etc/ssh/sshd_config +echo " ForceCommand internal-sftp -d %u" >> /etc/ssh/sshd_config + +########################################### +# 2. Create Account +########################################### + +groupadd cgeslsftp +useradd -s /sbin/nologin -g cgeslsftp cgeslsftp +echo 'cgeslsftp:cgESLPassword' | chpasswd + +########################################### +# 3. Create Account Directory +########################################### + +mkdir -p /sftp/Import +chown cgeslsftp:cgeslsftp /sftp/Import +chmod ugo+rw /sftp/Import + +########################################### +# 4. Reboot +########################################### + +reboot + +exit + +#################################################################################################### \ No newline at end of file diff --git a/create_sftp_start.sh b/create_sftp_start.sh new file mode 100644 index 0000000..95461fc --- /dev/null +++ b/create_sftp_start.sh @@ -0,0 +1,5 @@ +echo "Start Send CSV" +cd /home/root/ + +echo "Execute Send CSV" +./sendCSV.sh >/dev/null 2>&1 & \ No newline at end of file diff --git a/create_sftp_stop.sh b/create_sftp_stop.sh new file mode 100644 index 0000000..01b5e5c --- /dev/null +++ b/create_sftp_stop.sh @@ -0,0 +1 @@ +pkill -f sendCSV.sh \ No newline at end of file