您好,登錄后才能下訂單哦!
如何理解sftp server服務SftpGo,相信很多沒有經驗的人對此束手無策,為此本文總結了問題出現的原因和解決方法,通過這篇文章希望你能解決這個問題。
服務端主程序: sftpgosever
cli腳本: sftpcli
conf存儲服務配置文件
data創建sftp用戶目錄
backups存儲應用備份數據
本次基于k8s運行服務、mysql5.7做持久化存儲、騰訊云NFS服務做數據目錄、configmap掛載配置文件、nginx stream提供域名映射tcp訪問
docker pull taylordang/sftpgo:v1.0
查看具體文檔: [https://github.com/dtcka/sftpgo/tree/master/docker/sftpgo/alpine](https://github.com/dtcka/sftpgo/tree/master/docker/sftpgo/alpine)
構建腳本: [https://github.com/dtcka/sftpgo/blob/master/docker/rest-api-cli/Dockerfile](https://github.com/dtcka/sftpgo/blob/master/docker/rest-api-cli/Dockerfile)
{ "sftpd": { "bind_port": 2022, "bind_address": "0.0.0.0", "idle_timeout": 15, "max_auth_tries": 0, "umask": "0022", "banner": "", "upload_mode": 0, "actions": { "execute_on": [], "command": "", "http_notification_url": "" }, "keys": [], "kex_algorithms": [], "ciphers": [], "macs": [], "login_banner_file": "", "setstat_mode": 0, "enabled_ssh_commands": [ "md5sum", "sha1sum", "cd", "pwd", "scp" ], "keyboard_interactive_auth_program": "", "proxy_protocol": 0, "proxy_allowed": [] }, "data_provider": { "driver": "mysql", "name": "sftpgo", "host": "xxxxxx", "port": 9999, "username": "sftpgo", "password": "xxxxx", "sslmode": 0, "connection_string": "", "users_table": "users", "manage_users": 1, "track_quota": 2, "pool_size": 0, "users_base_dir": "", "actions": { "execute_on": [], "command": "", "http_notification_url": "" }, "external_auth_program": "", "external_auth_scope": 0, "credentials_path": "credentials", "pre_login_program": "" }, "httpd": { "bind_port": 8080, "bind_address": "0.0.0.0", "templates_path": "templates", "static_files_path": "static", "backups_path": "backups", "auth_user_file": "", "certificate_file": "", "certificate_key_file": "" } }
以上服務配置準備完成之后,運行容器會在數據庫中自動生成對應的表<br />
apiVersion: v1 kind: Service metadata: name: sftpgo namespace: sftp spec: clusterIP: xxxx externalTrafficPolicy: Cluster ports: - name: 8080-8080-tcp nodePort: 31807 port: 8080 protocol: TCP targetPort: 8080 - name: 2022-2022-tcp nodePort: 30865 port: 2022 protocol: TCP targetPort: 2022 selector: k8s-app: sftpgo qcloud-app: sftpgo sessionAffinity: None type: LoadBalancer status: loadBalancer: ingress: - ip: xxxx
- nginx配置文件 ``` apiVersion: v1 data: nginx.conf: |- user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } stream { server { listen 2022; proxy_pass sftpgo服務對應的內網ip:2022; } } kind: ConfigMap metadata: name: tcp-config namespace: sftp
##### 3.測試下服務狀態以及數據目錄權限 ![image.png](https://oscimg.oschina.net/oscnet/up-bee83bd7e27b4e982526a9d3c88a450f7fe.png) <br />測試ok:數據權限UID GID需要設置為1003.<br /> ##### 4. 設置域名解析到nginx的externalIps即可實現域名訪問 ![image.png](https://oscimg.oschina.net/oscnet/up-331b767e5d7c85d5f06f1a9c01daa105227.png) --- <br/> <br/> 附:
看完上述內容,你們掌握如何理解sftp server服務SftpGo的方法了嗎?如果還想學到更多技能或想了解更多相關內容,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。