First commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
# 20260512 tak created gitignore
|
||||||
|
.DS_Store
|
||||||
@@ -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
|
||||||
|
|
||||||
|
####################################################################################################
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
echo "Start Send CSV"
|
||||||
|
cd /home/root/
|
||||||
|
|
||||||
|
echo "Execute Send CSV"
|
||||||
|
./sendCSV.sh >/dev/null 2>&1 &
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
pkill -f sendCSV.sh
|
||||||
Reference in New Issue
Block a user