{"id":2342,"date":"2024-10-31T13:39:18","date_gmt":"2024-10-31T04:39:18","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=2342"},"modified":"2024-10-31T13:39:18","modified_gmt":"2024-10-31T04:39:18","slug":"sftp-%ec%83%81%ec%9c%84%ed%8f%b4%eb%8d%94-%ec%a0%91%ea%b7%bc%ec%a0%9c%ed%95%9c-%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=2342","title":{"rendered":"SFTP \uc0c1\uc704\ud3f4\ub354 \uc811\uadfc\uc81c\ud55c \uc124\uc815"},"content":{"rendered":"<p><strong>I. \ubaa9\ud45c<\/strong><\/p>\n<p>\ub9ac\ub205\uc2a4\uc5d0 FTP\ub97c \uc5f4\uc5b4\uc8fc\ub824\uace0 \ud558\ub294\ub370, \uacc4\uc815\uc0dd\uc131\uc2dc \ub2e4\ub978 \ud3f4\ub354\uae4c\uc9c0 \ubcfc\uc218\uc788\ub294 \ubb38\uc81c\uac00 \uc788\uc5b4. \ud574\ub2f9\ud3f4\ub354\ub9cc \uc811\uadfc\uac00\ub2a5\ud558\ub3c4\ub85d \ud558\uace0\uc790 \ud55c\ub2e4.<\/p>\n<p><strong>II. \uac1c\ubc1c\ubc0f \uc5f0\uad6c\ub0b4\uc6a9<\/strong><\/p>\n<p>1. \uacc4\uc815\uc0dd\uc131<\/p>\n<p style=\"padding-left: 40px;\">adduser apiuser<\/p>\n<p>2. \uadf8\ub8f9\uc9c0\uc815<\/p>\n<p style=\"padding-left: 40px;\">usermod -G npc apiuser<\/p>\n<p>3. \uad8c\ud55c\uc124\uc815<\/p>\n<p style=\"padding-left: 40px;\">chown root \/home\/apiuser<\/p>\n<p style=\"padding-left: 40px;\">chmod 755 \/home\/apiuser<\/p>\n<p>4. \ud558\uc704\ub514\ub809\ud1a0\ub9ac \uc0dd\uc131<\/p>\n<p style=\"padding-left: 40px;\">mkdir \/home\/apiuser\/atcenter<\/p>\n<p>5. \ud558\uc704\ub514\ub809\ud1a0\ub9ac \uad8c\ud55c\uc124\uc815<\/p>\n<p style=\"padding-left: 40px;\">chown root:npc \/home\/apiuser\/atcenter<\/p>\n<p style=\"padding-left: 40px;\">chmod 775 \/home\/apiuser\/atcenter<\/p>\n<p>&nbsp;<\/p>\n<p>6. SSHD \uc124\uc815<\/p>\n<p style=\"padding-left: 40px;\">1) \uae30\uc874\uc5d0 \uc788\ub358 sftp \/usr\/lib\/openssh\/sftp-server \ub97c \uc8fc\uc11d\ucc98\ub9ac\ud558\uace0\u00a0Subsystem sftp internal-sftp \uc744 \uc544\ub798\uc5d0 \ucd94\uac00<\/p>\n<p style=\"padding-left: 40px;\">sudo vi \/etc\/ssh\/sshd_config<\/p>\n<table style=\"margin-left: 40px; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td style=\"width: 330.039px;\"># Subsystem sftp \/usr\/lib\/openssh\/sftp-server<\/p>\n<p>Subsystem sftp internal-sftp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"padding-left: 40px;\">2) \uc81c\uc77c \ud558\ub2e8\uc5d0 \uc544\ub798\uc640 \uac19\uc774 \ucd94\uac00<\/p>\n<table style=\"margin-left: 40px; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\" border=\"1\">\n<tbody>\n<tr>\n<td>Match User apiuser<\/p>\n<p>ChrootDirectory %h<\/p>\n<p>X11Forwarding no<\/p>\n<p>AllowTcpForwarding no<\/p>\n<p>ForceCommand internal-sftp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>7. SSHD \ub370\ubaac \uc7ac\uc2dc\uc791<\/p>\n<p style=\"padding-left: 40px;\">service sshd restart<\/p>\n<p>&nbsp;<\/p>\n<p><b>III. \uacb0\ub860<\/b><\/p>\n<p><b>\uc544\ub798\uc640<\/b> <b>\uac19\uc774<\/b> <b>\ud574\ub2f9<\/b> <b>\uacc4\uc815\uc758<\/b> <b>\uc0c1\uc704<\/b><b> \/home\/<\/b><b>\ub2e4\ub978\uacc4\uc815<\/b> <b>\uc774<\/b> <b>\uc548\ubcf4\uc774\uace0<\/b> <b>\ud574\ub2f9\uacc4\uc815\uc758<\/b> <b>\ub514\ub809\ud1a0\ub9ac\ub9cc<\/b> <b>\ubcf4\uc774\uac8c<\/b> <b>\ub418\uc5c8\ub2e4<\/b><b>.<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-2343 aligncenter\" src=\"http:\/\/blog.moramcnt.com\/wp-content\/uploads\/2024\/10\/sftp-300x168.png\" alt=\"\" width=\"524\" height=\"293\" srcset=\"http:\/\/blog.moramcnt.com\/wp-content\/uploads\/2024\/10\/sftp-300x168.png 300w, http:\/\/blog.moramcnt.com\/wp-content\/uploads\/2024\/10\/sftp-768x430.png 768w, http:\/\/blog.moramcnt.com\/wp-content\/uploads\/2024\/10\/sftp.png 789w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I. \ubaa9\ud45c \ub9ac\ub205\uc2a4\uc5d0 FTP\ub97c \uc5f4\uc5b4\uc8fc\ub824\uace0 \ud558\ub294\ub370, \uacc4\uc815\uc0dd\uc131\uc2dc \ub2e4\ub978 \ud3f4\ub354\uae4c\uc9c0 \ubcfc\uc218\uc788\ub294 \ubb38\uc81c\uac00 \uc788\uc5b4. \ud574\ub2f9\ud3f4\ub354\ub9cc \uc811\uadfc\uac00\ub2a5\ud558\ub3c4\ub85d \ud558\uace0\uc790 \ud55c\ub2e4. II. \uac1c\ubc1c\ubc0f \uc5f0\uad6c\ub0b4\uc6a9 1. \uacc4\uc815\uc0dd\uc131 adduser apiuser 2. \uadf8\ub8f9\uc9c0\uc815 usermod -G npc apiuser 3. \uad8c\ud55c\uc124\uc815 chown root \/home\/apiuser chmod 755 \/home\/apiuser 4. \ud558\uc704\ub514\ub809\ud1a0\ub9ac \uc0dd\uc131 mkdir \/home\/apiuser\/atcenter 5. \ud558\uc704\ub514\ub809\ud1a0\ub9ac \uad8c\ud55c\uc124\uc815 chown root:npc \/home\/apiuser\/atcenter chmod 775 \/home\/apiuser\/atcenter &nbsp; 6. SSHD \uc124\uc815 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[68],"tags":[283,284],"class_list":["post-2342","post","type-post","status-publish","format-standard","hentry","category-etc","tag-sftp","tag-284"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2342"}],"version-history":[{"count":3,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2342\/revisions"}],"predecessor-version":[{"id":2346,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2342\/revisions\/2346"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2342"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}