{"id":16220,"date":"2025-04-18T22:42:54","date_gmt":"2025-04-18T14:42:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/16220.html"},"modified":"2025-04-18T22:42:54","modified_gmt":"2025-04-18T14:42:54","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%97%b4%e8%bf%9b%e8%a1%8c%e6%96%87%e4%bb%b6%e4%bc%a0%e8%be%93-sftpscp%e4%b8%80%e7%af%87%e6%90%9e%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/16220.html","title":{"rendered":"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a"},"content":{"rendered":"<h2>1.\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b<\/h2>\n<p>\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f&#xff0c;\u4e24\u53f0\u670d\u52a1\u5668\u4e4b\u95f4\u9700\u8981\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u7684\u65f6\u5019&#xff0c;\u6216\u8bb8\u6211\u4eec\u4f1a\u60f3\u5230FTP&#xff0c;\u8fd9\u4e5f\u662f\u6211\u4eec\u5e38\u89c1\u7684\u5b9e\u73b0\u65b9\u5f0f&#xff0c;\u4f46\u662f\u5982\u679c\u6211\u4eec\u4e0d\u80fd\u64cd\u4f5c\u8fdc\u7a0b\u670d\u52a1\u5668&#xff0c;\u65e0\u6cd5\u5224\u65ad\u8fdc\u7a0b\u670d\u52a1\u5668\u662f\u5426\u5b89\u88c5\u4e86FTP\u5462&#xff0c;\u4f17\u6240\u5468\u77e5&#xff0c;FTP\u4f7f\u7528\u7684\u524d\u63d0\u65f6\u786e\u5b9a\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u4e86FTP\u670d\u52a1&#xff0c;\u5e76\u4e14\u6b63\u5728\u8fd0\u884cFTP\u670d\u52a1\u5668\u8f6f\u4ef6&#xff0c;\u8fd9\u662f\u6700\u5927\u7684\u524d\u63d0&#xff0c;\u5982\u679c\u6211\u4eec\u4e0d\u77e5\u9053&#xff0c;\u90a3\u4e48\u5c31\u4e0d\u80fd\u8d38\u7136\u7684\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002<\/p>\n<p>\u6211\u7684\u9700\u6c42\u662f&#xff1a;\u6211\u53ea\u77e5\u9053\u5bf9\u65b9\u670d\u52a1\u5668\u7684ip\u3001\u7aef\u53e3\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801&#xff0c;\u6587\u4ef6\u5730\u5740\u3002\u5176\u4ed6\u7684\u6211\u4e00\u6982\u4e0d\u77e5\u3002<\/p>\n<p>\u90a3\u4e48\u8fd8\u6709\u4ec0\u4e48\u65b9\u5f0f\u5462&#xff0c;SFTP&#xff1f;SCP&#xff1f;<\/p>\n<p>SFTP\u548cFTP\u4e0d\u5c31\u5c11\u4e86\u4e00\u4e2aS&#xff0c;\u5e94\u8be5\u4e5f\u9700\u8981\u5b89\u88c5FTP\u5427&#xff1f;\u7b54\u6848\u662f&#xff1a;NO<\/p>\n<p>SFTP&#xff1a;\u662f\u4e00\u79cd\u57fa\u4e8eSSH\u534f\u8bae\u7684\u7f51\u7edc\u534f\u8bae&#xff0c;\u7528\u4e8e\u5728\u7f51\u7edc\u4e0a\u5b89\u5168\u7684\u4f20\u8f93\u534f\u8bae&#xff0c;SFTP\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b89\u5168\u7684\u6587\u4ef6\u4f20\u8f93\u673a\u5236&#xff0c;\u5141\u8bb8\u7528\u6237\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u52a0\u5bc6\u6570\u636e&#xff0c;\u4ece\u800c\u4fdd\u62a4\u6570\u636e\u514d\u53d7\u7a83\u542c\u548c\u7be1\u6539\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a;OpenSSH\u652f\u6301SFTP&#xff0c;\u4e5f\u5c31\u662f\u8bf4\u53ea\u8981\u670d\u52a1\u5668\u4e2d\u6709OpenSSH&#xff0c;SFTP\u5c31\u53ef\u4ee5\u4f7f\u7528\u3002<\/span><\/p>\n<p>FTP&#xff1a;\u662f\u4e00\u79cd\u7528\u4e8e\u5728\u7f51\u7edc\u4e0a\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u7684\u534f\u8bae\u3002\u5b83\u662f\u57fa\u4e8e\u6587\u672c\u7684\u534f\u8bae&#xff0c;\u5141\u8bb8\u7528\u6237\u4e0a\u4f20\u3001\u4e0b\u8f7d\u3001\u5220\u9664\u548c\u91cd\u547d\u540d\u6587\u4ef6\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a;\u9700\u8981\u5b89\u88c5\u914d\u7f6eFTP\u670d\u52a1\u5230\u670d\u52a1\u5668\u3002<\/span><\/p>\n<p><span style=\"color:#0d0016\">SCP&#xff1a;\u662f\u4e00\u79cd\u7528\u4e8e\u5728\u670d\u52a1\u5668\u4e4b\u95f4\u5b89\u5168\u590d\u5236\u6587\u4ef6\u7684\u7f51\u7edc\u534f\u8bae\u3002\u57fa\u4e8eSSH\u534f\u8bae&#xff0c;\u63d0\u4f9b\u4e86\u4e00\u4e2a\u52a0\u5bc6\u7684\u65b9\u6cd5\u6765\u4f20\u8f93\u6587\u4ef6&#xff0c;\u786e\u4fdd\u6570\u636e\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u7684\u5b89\u5168\u6027\u3002SCP\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u901a\u5e38\u7528\u4e8e\u8fdc\u7a0b\u670d\u52a1\u5668\u7ba1\u7406\u3001\u6587\u4ef6\u5907\u4efd\u548c\u7cfb\u7edf\u7ef4\u62a4\u3002<\/span><\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a;\u6211\u8ba4\u4e3a\u53ea\u8981\u670d\u52a1\u5668\u53ef\u4ee5\u6267\u884clinux\u547d\u4ee4&#xff0c;\u5e94\u8be5\u90fd\u53ef\u4ee5\u5b9e\u73b0\u3002<\/span><\/p>\n<h2>2.\u5b9e\u73b0\u65b9\u5f0f<\/h2>\n<p>\u6211\u7684\u5b9e\u73b0\u65b9\u5f0f\u662f\u57fa\u4e8eSpring Boot\u521b\u5efa\u5b8c\u6210\u7684\u54c8&#xff0c;\u5927\u5bb6\u5982\u679c\u51fa\u73b0\u4e86\u4ec0\u4e48\u95ee\u9898&#xff0c;\u5f97\u653e\u5230\u8bc4\u8bba\u533a&#xff0c;\u5f97\u91cd\u65b0\u770b\u770b\u5177\u4f53\u662f\u4ec0\u4e48\u539f\u56e0\u3002<\/p>\n<h3>2.1 FTP\u65b9\u5f0f<\/h3>\n<p>\u8fd9\u4e2a\u5927\u5bb6\u5c31\u53c2\u8003\u7f51\u4e0a\u8be6\u7ec6\u7684\u6587\u7ae0\u54c8&#xff0c;\u4e3b\u8981\u6211\u7684\u9700\u6c42\u4e0d\u80fd\u4f7f\u7528\u8fd9\u4e2a\u65b9\u5f0f&#x1f604;&#xff0c;\u6240\u4ee5\u6ca1\u6709\u4ee3\u7801&#x1f61c;\u3002<\/p>\n<h3>2.2 SFTP\u65b9\u5f0f<\/h3>\n<p>\u7b2c\u4e00\u4e2a\u80af\u5b9a\u5c31\u662f\u5bfc\u5165\u4f9d\u8d56<\/p>\n<p>&lt;dependency&gt;<br \/>\n    &lt;groupId&gt;com.jcraft&lt;\/groupId&gt;<br \/>\n    &lt;artifactId&gt;jsch&lt;\/artifactId&gt;<br \/>\n    &lt;version&gt;0.1.53&lt;\/version&gt;<br \/>\n&lt;\/dependency&gt;        <\/p>\n<p>\u7136\u540e&#xff0c;\u54b1\u4eec\u5c31\u5f97\u5199\u4e00\u4e2a\u5de5\u5177\u7c7b\u4e86<\/p>\n<p>import com.jcraft.jsch.Channel;<br \/>\nimport com.jcraft.jsch.ChannelSftp;<br \/>\nimport com.jcraft.jsch.JSch;<br \/>\nimport com.jcraft.jsch.Session;<br \/>\nimport java.io.File;<\/p>\n<p>public class ScpFileTransferUtil {<\/p>\n<p>    \/\/ \u8fdc\u7a0b\u670d\u52a1\u5668\u7684IP\u5730\u5740<br \/>\n    private static final String IP &#061; &#034;192.xxx.xxx.xx&#034;;<br \/>\n    \/\/ \u8fdc\u7a0b\u670d\u52a1\u5668\u7684SSH\u7aef\u53e3<br \/>\n    private static final int PORT &#061; xxxx;<br \/>\n    \/\/ \u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u7528\u6237\u540d<br \/>\n    private static final String USER_NAME &#061; &#034;root&#034;;<br \/>\n    \/\/ \u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u5bc6\u7801<br \/>\n    private static final String PASSWORD &#061; &#034;xxxxxx&#034;;<\/p>\n<p>    \/**<br \/>\n     * \u4ece\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0b\u8f7d\u6587\u4ef6\u5230\u672c\u5730<br \/>\n     *<br \/>\n     * &#064;param remotePath \u8fdc\u7a0b\u6587\u4ef6\u8def\u5f84<br \/>\n     * &#064;param localPath  \u672c\u5730\u76ee\u6807\u76ee\u5f55<br \/>\n     *\/<br \/>\n    public static void scpFromRemote(String remotePath, String localPath) {<br \/>\n        try {<br \/>\n            JSch jsch &#061; new JSch();<br \/>\n            Session session &#061; jsch.getSession(USER_NAME, IP, PORT);<br \/>\n            session.setPassword(PASSWORD);<\/p>\n<p>            \/\/ \u8bbe\u7f6e\u914d\u7f6e\u9879<br \/>\n            java.util.Properties config &#061; new java.util.Properties();<br \/>\n            config.put(&#034;StrictHostKeyChecking&#034;, &#034;no&#034;);<br \/>\n            session.setConfig(config);<\/p>\n<p>            \/\/ \u8fde\u63a5\u4f1a\u8bdd<br \/>\n            System.out.println(&#034;Connecting to SSH server&#8230;&#034;);<br \/>\n            session.connect();<\/p>\n<p>            \/\/ \u6253\u5f00 SFTP \u901a\u9053<br \/>\n            Channel channel &#061; session.openChannel(&#034;sftp&#034;);<br \/>\n            channel.connect();<br \/>\n            ChannelSftp sftpChannel &#061; (ChannelSftp) channel;<\/p>\n<p>            \/\/ \u89e3\u6790\u8fdc\u7a0b\u6587\u4ef6\u8def\u5f84\u4e2d\u7684\u6587\u4ef6\u540d<br \/>\n            String fileName &#061; extractFileNameFromPath(remotePath);<\/p>\n<p>            \/\/ \u521b\u5efa\u672c\u5730\u6587\u4ef6\u8def\u5f84<br \/>\n            File localFile &#061; new File(localPath, fileName);<\/p>\n<p>            \/\/ \u521b\u5efa\u672c\u5730\u76ee\u6807\u76ee\u5f55<br \/>\n            File directory &#061; localFile.getParentFile();<br \/>\n            if (!directory.exists()) {<br \/>\n                boolean mkdirResult &#061; directory.mkdirs();<br \/>\n                if (mkdirResult) {<br \/>\n                    System.out.println(&#034;\u521b\u5efa\u6587\u4ef6\u5939\u6210\u529f&#034;);<br \/>\n                } else {<br \/>\n                    System.out.println(&#034;\u521b\u5efa\u6587\u4ef6\u5939\u5931\u8d25&#034;);<br \/>\n                    throw new RuntimeException(&#034;\u521b\u5efa\u6587\u4ef6\u5939\u5931\u8d25&#xff01;&#034;);<br \/>\n                }<br \/>\n            }<\/p>\n<p>            \/\/ \u4e0b\u8f7d\u6587\u4ef6<br \/>\n            System.out.println(&#034;Downloading file from remote path: &#034; &#043; remotePath);<br \/>\n            sftpChannel.get(remotePath, localFile.getAbsolutePath());<\/p>\n<p>            System.out.println(&#034;\u6587\u4ef6\u4e0b\u8f7d\u6210\u529f&#034;);<\/p>\n<p>            \/\/ \u5173\u95ed\u901a\u9053\u548c\u4f1a\u8bdd<br \/>\n            channel.disconnect();<br \/>\n            session.disconnect();<\/p>\n<p>        } catch (Exception e) {<br \/>\n            e.printStackTrace();<br \/>\n            System.err.println(&#034;\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25&#xff1a;&#034; &#043; e.getMessage());<br \/>\n        }<br \/>\n    }<\/p>\n<p>    \/**<br \/>\n     * \u4ece\u8def\u5f84\u4e2d\u63d0\u53d6\u6587\u4ef6\u540d<br \/>\n     *<br \/>\n     * &#064;param path \u5b8c\u6574\u8def\u5f84<br \/>\n     * &#064;return \u6587\u4ef6\u540d<br \/>\n     *\/<br \/>\n    private static String extractFileNameFromPath(String path) {<br \/>\n        int lastSeparatorIndex &#061; path.lastIndexOf(File.separator);<br \/>\n        return path.substring(lastSeparatorIndex &#043; 1);<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) {<br \/>\n        System.out.println(&#034;Main method started.&#034;);<br \/>\n        \/\/\u83b7\u53d6\u5f00\u59cb\u65f6\u95f4<br \/>\n        long startTime &#061; System.currentTimeMillis();<br \/>\n        String remotePath &#061; &#034;\/data\/ceshiDown\/eac207eeeb2095cc560f94b6e7e33f49_4.mp4&#034;; \/\/ \u8fdc\u7a0b\u6587\u4ef6\u8def\u5f84<br \/>\n        String localPath &#061; &#034;E:\\\\\\\\mnt\\\\\\\\data_process_net\\\\\\\\token&#034;; \/\/ \u672c\u5730\u76ee\u6807\u76ee\u5f55<\/p>\n<p>        scpFromRemote(remotePath, localPath);<br \/>\n        System.out.println(&#034;Main method finished.&#034;);<br \/>\n        \/\/\u83b7\u53d6\u7ed3\u675f\u65f6\u95f4<br \/>\n        long endTime &#061; System.currentTimeMillis();<br \/>\n        System.out.println(&#034;\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4&#xff1a;&#034; &#043; (endTime &#8211; startTime)\/1000 &#043; &#034;s&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5e94\u8be5\u4e0d\u9700\u8981\u6211\u8bb2\u89e3\u4e00\u4e0b\u4e86\u5427&#xff0c;\u6211\u76f8\u4fe1\u5144\u5f1f\u4eec\u90fd\u53ef\u4ee5\u770b\u61c2\u7684&#xff0c;\u5fc5\u8981\u7684\u6ce8\u91ca\u6211\u90fd\u52a0\u4e0a\u5566\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"361\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418144253-680264ed2987e.png\" width=\"1200\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"344\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418144253-680264ed6fbc3.png\" width=\"981\" \/><\/p>\n<p>\u641e\u5b9a&#xff01;<\/p>\n<h3>2.3 SCP\u65b9\u5f0f<\/h3>\n<p>SCP\u7684\u5b9e\u73b0\u65b9\u5f0f&#xff0c;\u6709\u4e00\u4e9b\u7a0d\u5fae\u7684\u9ebb\u70e6&#xff0c;\u9700\u8981\u5199\u4e00\u4e2aexpect\u811a\u672c&#xff0c;\u4e3a\u4ec0\u4e48\u4f7f\u7528\u811a\u672c\u5462&#xff0c;\u8bf4\u660e\u4e00\u4e0b&#xff0c;\u5728\u6211\u4eec\u4f7f\u7528scp\u547d\u4ee4\u5728\u62f7\u8d1d\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u65f6\u5019&#xff0c;\u6211\u4eec\u4e2d\u95f4\u9700\u8981\u8f93\u5165\u5bc6\u7801\u3002<\/p>\n<p>\u4f46\u662f\u6211\u4eec\u5728\u6267\u884c\u4ee3\u7801\u7684\u65f6\u5019&#xff0c;\u53ef\u4ee5\u81ea\u52a8\u8bc6\u522b\u9700\u8981\u8f93\u5165\u5bc6\u7801&#xff0c;\u7136\u540e\u81ea\u52a8\u5316\u8f93\u5165\u5bc6\u7801\u5417&#xff1f;\u7b54\u6848\u662f\u4e0d\u80fd\u7684\u3002<\/p>\n<p>\u6240\u4ee5\u8fd9\u91cc\u4ecb\u5165expect\u811a\u672c\u7684\u4f5c\u7528\u5c31\u662f\u8bc6\u522b\u54ea\u91cc\u9700\u8981\u8f93\u5165\u5bc6\u7801&#xff0c;\u7136\u540e\u81ea\u52a8\u5316\u8f93\u5165\u5bc6\u7801\u3002<\/p>\n<p>\u8fd9\u91cc\u5e94\u8be5\u4e0d\u9700\u8981\u5b89\u88c5\u4efb\u4f55\u7684\u4f9d\u8d56\u7684\u3002<\/p>\n<p>\u76f4\u63a5\u5c31\u662f\u5de5\u5177\u7c7b&#xff1a;<\/p>\n<p>import lombok.extern.slf4j.Slf4j;<\/p>\n<p>import java.io.BufferedReader;<br \/>\nimport java.io.File;<br \/>\nimport java.io.IOException;<br \/>\nimport java.io.InputStreamReader;<br \/>\n&#064;Slf4j<br \/>\npublic class ScpUtil {<\/p>\n<p>    public static void scpFromRemoteUsingExpect(String expectScriptPath, String user, String host, int port, String remotePath, String localPath, String password) {<br \/>\n        Process process &#061; null;<br \/>\n        try {<br \/>\n            \/\/ \u786e\u4fdd\u76ee\u6807\u76ee\u5f55\u5b58\u5728<br \/>\n            File localDir &#061; new File(localPath);<br \/>\n            if (!localDir.exists()) {<br \/>\n                boolean created &#061; localDir.mkdirs(); \/\/ \u521b\u5efa\u591a\u7ea7\u76ee\u5f55<br \/>\n                if (!created) {<br \/>\n                    throw new IOException(&#034;\u65e0\u6cd5\u521b\u5efa\u76ee\u6807\u76ee\u5f55: &#034; &#043; localPath);<br \/>\n                }<br \/>\n            }<br \/>\n            \/\/ \u6784\u5efa expect \u811a\u672c\u7684\u547d\u4ee4\u884c\u53c2\u6570<br \/>\n            String[] params &#061; {user, host, Integer.toString(port), remotePath, localPath, password};<br \/>\n            String command &#061; expectScriptPath &#043; &#034; &#034; &#043; String.join(&#034; &#034;, params);<\/p>\n<p>            \/\/ \u6267\u884c expect \u811a\u672c<br \/>\n            process &#061; Runtime.getRuntime().exec(command);<\/p>\n<p>            \/\/ \u8bfb\u53d6\u547d\u4ee4\u7684\u8f93\u51fa<br \/>\n            BufferedReader reader &#061; new BufferedReader(new InputStreamReader(process.getInputStream()));<br \/>\n            String line;<br \/>\n            while ((line &#061; reader.readLine()) !&#061; null) {<br \/>\n                System.out.println(line);<br \/>\n            }<\/p>\n<p>            \/\/ \u7b49\u5f85\u547d\u4ee4\u6267\u884c\u5b8c\u6210<br \/>\n            int exitCode &#061; process.waitFor();<br \/>\n            if (exitCode &#061;&#061; 0) {<br \/>\n                log.info(&#034;\u6587\u4ef6\u4e0b\u8f7d\u6210\u529f&#034;);<br \/>\n            } else {<br \/>\n                log.info(&#034;\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25&#xff0c;\u9000\u51fa\u4ee3\u7801&#xff1a;{}&#034;, exitCode);<br \/>\n            }<br \/>\n        } catch (Exception e) {<br \/>\n            e.printStackTrace();<br \/>\n            log.info(&#034;\u6587\u4ef6\u4e0b\u8f7d\u5931\u8d25&#xff1a;{}&#034;, e.getMessage());<br \/>\n        }finally {<br \/>\n            \/\/ \u786e\u4fdd\u8d44\u6e90\u88ab\u91ca\u653e<br \/>\n            if (process !&#061; null) {<br \/>\n                process.destroy();<br \/>\n            }<br \/>\n        }<br \/>\n    }<\/p>\n<p>    public static void scpDirectoryFromRemoteUsingExpect(String expectScriptPath, String user, String host, int port, String remotePath, String localPath, String password) {<br \/>\n        Process process &#061; null;<br \/>\n        try {<br \/>\n            \/\/ \u786e\u4fdd\u76ee\u6807\u76ee\u5f55\u5b58\u5728<br \/>\n            File localDir &#061; new File(localPath);<br \/>\n            if (!localDir.exists()) {<br \/>\n                boolean created &#061; localDir.mkdirs(); \/\/ \u521b\u5efa\u591a\u7ea7\u76ee\u5f55<br \/>\n                if (!created) {<br \/>\n                    throw new IOException(&#034;\u65e0\u6cd5\u521b\u5efa\u76ee\u6807\u76ee\u5f55: &#034; &#043; localPath);<br \/>\n                }<br \/>\n            }<br \/>\n            \/\/ \u6784\u5efa expect \u811a\u672c\u7684\u547d\u4ee4\u884c\u53c2\u6570&#xff0c;\u786e\u4fdd remotePath \u662f\u4e00\u4e2a\u76ee\u5f55<br \/>\n            String[] params &#061; {user, host, Integer.toString(port), remotePath &#043; &#034;\/&#034;, localPath, password};<br \/>\n            String command &#061; expectScriptPath &#043; &#034; &#034; &#043; String.join(&#034; &#034;, params);<\/p>\n<p>            \/\/ \u6267\u884c expect \u811a\u672c<br \/>\n            process &#061; Runtime.getRuntime().exec(command);<\/p>\n<p>            \/\/ \u8bfb\u53d6\u547d\u4ee4\u7684\u8f93\u51fa<br \/>\n            BufferedReader reader &#061; new BufferedReader(new InputStreamReader(process.getInputStream()));<br \/>\n            String line;<br \/>\n            while ((line &#061; reader.readLine()) !&#061; null) {<br \/>\n                System.out.println(line);<br \/>\n            }<\/p>\n<p>            \/\/ \u7b49\u5f85\u547d\u4ee4\u6267\u884c\u5b8c\u6210<br \/>\n            int exitCode &#061; process.waitFor();<br \/>\n            if (exitCode &#061;&#061; 0) {<br \/>\n                System.out.println(&#034;\u6587\u4ef6\u5939\u4e0b\u8f7d\u6210\u529f&#034;);<br \/>\n            } else {<br \/>\n                System.err.println(&#034;\u6587\u4ef6\u5939\u4e0b\u8f7d\u5931\u8d25&#xff0c;\u9000\u51fa\u4ee3\u7801&#xff1a;&#034; &#043; exitCode);<br \/>\n            }<br \/>\n        } catch (IOException e) {<br \/>\n            e.printStackTrace();<br \/>\n            log.info(&#034;\u6587\u4ef6\u5939\u4e0b\u8f7d\u5931\u8d25&#xff1a;{}&#034;, e.getMessage());<br \/>\n        } catch (InterruptedException e) {<br \/>\n            Thread.currentThread().interrupt(); \/\/ \u91cd\u65b0\u8bbe\u7f6e\u4e2d\u65ad\u72b6\u6001<br \/>\n            e.printStackTrace();<br \/>\n            log.info(&#034;\u6587\u4ef6\u5939\u4e0b\u8f7d\u88ab\u4e2d\u65ad&#xff1a;{}&#034;, e.getMessage());<br \/>\n        } finally {<br \/>\n            \/\/ \u786e\u4fdd\u8d44\u6e90\u88ab\u91ca\u653e<br \/>\n            if (process !&#061; null) {<br \/>\n                try {<br \/>\n                    process.getInputStream().close();<br \/>\n                    process.getOutputStream().close();<br \/>\n                    process.getErrorStream().close();<br \/>\n                } catch (IOException e) {<br \/>\n                    e.printStackTrace();<br \/>\n                }<br \/>\n                process.destroy();<br \/>\n            }<br \/>\n        }<br \/>\n    }<\/p>\n<p>    public static void main(String[] args) {<br \/>\n        log.info(&#034;Main method started.&#034;);<br \/>\n        \/\/ \u83b7\u53d6\u5f00\u59cb\u65f6\u95f4<br \/>\n        long startTime &#061; System.currentTimeMillis();<br \/>\n        String expectScriptPath &#061; &#034;\/script\/scp_download_directory.exp&#034;; \/\/ expect \u811a\u672c\u7684\u8def\u5f84<br \/>\n        String remotePath &#061; &#034;\/data\/ceshiDown\/&#034;;<br \/>\n        String localPath &#061; &#034;\/data\/ceshi2&#034;;<br \/>\n        ScpUtil.scpDirectoryFromRemoteUsingExpect(expectScriptPath, USER_NAME, IP, PORT, remotePath, localPath, PASSWORD);<br \/>\n        log.info(&#034;Main method finished.&#034;);<br \/>\n        \/\/ \u83b7\u53d6\u7ed3\u675f\u65f6\u95f4<br \/>\n        long endTime &#061; System.currentTimeMillis();<br \/>\n        System.out.println(&#034;\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4&#xff1a;&#034; &#043; (endTime &#8211; startTime) \/ 1000 &#043; &#034;s&#034;);<br \/>\n    }<br \/>\n} <\/p>\n<p>\u4e0a\u9762\u8fd9\u4e2a\u5de5\u5177\u7c7b\u5462&#xff0c;scpFromRemoteUsingExpect()\u65b9\u6cd5\u662f\u590d\u5236\u6587\u4ef6\u7684&#xff0c;scpDirectoryFromRemoteUsingExpect()\u662f\u590d\u5236\u6587\u4ef6\u5939\u7684\u3002\u6ce8\u610f\u4e00\u4e0b\u54e6\u3002<\/p>\n<p>\u6700\u7ec8\u8981\u7684\u6765\u5566&#xff0c;\u811a\u672c\u600e\u4e48\u5199\u5462\u3002 \u590d\u5236\u6587\u4ef6\u7684\u811a\u672c\u4e0b\u8f7d\u5730\u5740&#xff1a;scp\u590d\u5236\u8fdc\u7a0b\u670d\u52a1\u5668\u6587\u4ef6\u81f3\u672c\u5730\u670d\u52a1\u5668expect\u811a\u672c<\/p>\n<p>\u590d\u5236\u6587\u4ef6\u5939\u7684\u811a\u672c\u4e0b\u8f7d\u5730\u5740&#xff1a;scp\u590d\u5236\u8fdc\u7a0b\u670d\u52a1\u5668\u6587\u4ef6\u5939\u81f3\u672c\u5730\u670d\u52a1\u5668expect\u811a\u672c<\/p>\n<p><span style=\"color:#ffd900\">\u82e5\u662f\u6587\u4ef6\u4e0b\u8f7d\u4e0d\u4e86&#xff0c;\u5343\u4e07\u522b\u82b1\u94b1\u4e0b\u8f7d&#xff0c;\u8054\u7cfb\u6211&#xff0c;\u6211\u53d1\u4f60\u3002<\/span><\/p>\n<p>\u8fd9\u91cc\u6211\u5c31\u4e0d\u6d4b\u8bd5\u4e86&#xff0c;\u6211\u662f\u5728\u670d\u52a1\u5668\u6d4b\u8bd5\u7684&#xff0c;\u662f\u884c\u5f97\u901a\u7684\u3002 \u5b8c\u7ed3&#xff01;\u6492\u82b1&#xff01;\u4ee5\u4e0a\u5185\u5bb9&#xff0c;\u82e5\u6709\u4efb\u4f55\u95ee\u9898&#xff0c;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u7559\u8a00&#xff0c;\u5728\u6b64&#xff0c;\u82e5\u6709\u66f4\u597d\u7684\u89e3\u51b3\u65b9\u6848\u7684\u5144\u5f1f&#xff0c;\u4e5f\u8bf7\u7559\u8a00&#xff0c;\u8ba9\u6211\u5b66\u4e60\u4e00\u4e0b\u54c8<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf23\u6b21\u3002\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f\uff0c\u4e24\u53f0\u670d\u52a1\u5668\u4e4b\u95f4\u9700\u8981\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u7684\u65f6\u5019\uff0c\u6216\u8bb8\u6211\u4eec\u4f1a\u60f3\u5230FTP\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5e38\u89c1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u4f46\u662f\u5982\u679c\u6211\u4eec\u4e0d\u80fd\u64cd\u4f5c\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u65e0\u6cd5\u5224\u65ad\u8fdc\u7a0b\u670d\u52a1\u5668\u662f\u5426\u5b89\u88c5\u4e86FTP\u5462\uff0c\u4f17\u6240\u5468\u77e5\uff0cFTP\u4f7f\u7528\u7684\u524d\u63d0\u65f6\u786e\u5b9a\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u4e86FTP\u670d\u52a1\uff0c\u5e76\u4e14\u6b63\u5728\u8fd0\u884cFTP\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u8fd9\u662f\u6700\u5927\u7684\u524d\u63d0\uff0c\u5982\u679c\u6211\u4eec\u4e0d\u77e5\u9053\uff0c\u90a3\u4e48\u5c31\u4e0d\u80fd\u8d38\u7136\u7684\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002\u90a3\u4e48\u8fd8\u6709\u4ec0\u4e48\u65b9\u5f0f\u5462\uff0cSFTP\uff1fSCP\uff1fSFTP\u548cFTP\u4e0d\u5c31\u5c11\u4e86\u4e00\u4e2aS\uff0c\u5e94\u8be5\u4e5f\u9700\u8981\u5b89\u88c5FTP\u5427\uff1f_sftp scp<\/p>\n","protected":false},"author":2,"featured_media":16218,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,77,43],"topic":[],"class_list":["post-16220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-ssh","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/16220.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf23\u6b21\u3002\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f\uff0c\u4e24\u53f0\u670d\u52a1\u5668\u4e4b\u95f4\u9700\u8981\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u7684\u65f6\u5019\uff0c\u6216\u8bb8\u6211\u4eec\u4f1a\u60f3\u5230FTP\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5e38\u89c1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u4f46\u662f\u5982\u679c\u6211\u4eec\u4e0d\u80fd\u64cd\u4f5c\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u65e0\u6cd5\u5224\u65ad\u8fdc\u7a0b\u670d\u52a1\u5668\u662f\u5426\u5b89\u88c5\u4e86FTP\u5462\uff0c\u4f17\u6240\u5468\u77e5\uff0cFTP\u4f7f\u7528\u7684\u524d\u63d0\u65f6\u786e\u5b9a\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u4e86FTP\u670d\u52a1\uff0c\u5e76\u4e14\u6b63\u5728\u8fd0\u884cFTP\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u8fd9\u662f\u6700\u5927\u7684\u524d\u63d0\uff0c\u5982\u679c\u6211\u4eec\u4e0d\u77e5\u9053\uff0c\u90a3\u4e48\u5c31\u4e0d\u80fd\u8d38\u7136\u7684\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002\u90a3\u4e48\u8fd8\u6709\u4ec0\u4e48\u65b9\u5f0f\u5462\uff0cSFTP\uff1fSCP\uff1fSFTP\u548cFTP\u4e0d\u5c31\u5c11\u4e86\u4e00\u4e2aS\uff0c\u5e94\u8be5\u4e5f\u9700\u8981\u5b89\u88c5FTP\u5427\uff1f_sftp scp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/16220.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T14:42:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418144253-680264ed2987e.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16220.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/16220.html\",\"name\":\"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T14:42:54+00:00\",\"dateModified\":\"2025-04-18T14:42:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/16220.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/16220.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/16220.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/16220.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.1k\u6b21\uff0c\u70b9\u8d5e24\u6b21\uff0c\u6536\u85cf23\u6b21\u3002\u5728\u4e00\u4e9b\u7279\u6b8a\u573a\u666f\uff0c\u4e24\u53f0\u670d\u52a1\u5668\u4e4b\u95f4\u9700\u8981\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93\u7684\u65f6\u5019\uff0c\u6216\u8bb8\u6211\u4eec\u4f1a\u60f3\u5230FTP\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u5e38\u89c1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u4f46\u662f\u5982\u679c\u6211\u4eec\u4e0d\u80fd\u64cd\u4f5c\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u65e0\u6cd5\u5224\u65ad\u8fdc\u7a0b\u670d\u52a1\u5668\u662f\u5426\u5b89\u88c5\u4e86FTP\u5462\uff0c\u4f17\u6240\u5468\u77e5\uff0cFTP\u4f7f\u7528\u7684\u524d\u63d0\u65f6\u786e\u5b9a\u670d\u52a1\u5668\u4e0a\u914d\u7f6e\u4e86FTP\u670d\u52a1\uff0c\u5e76\u4e14\u6b63\u5728\u8fd0\u884cFTP\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u8fd9\u662f\u6700\u5927\u7684\u524d\u63d0\uff0c\u5982\u679c\u6211\u4eec\u4e0d\u77e5\u9053\uff0c\u90a3\u4e48\u5c31\u4e0d\u80fd\u8d38\u7136\u7684\u4f7f\u7528\u8be5\u65b9\u5f0f\u3002\u90a3\u4e48\u8fd8\u6709\u4ec0\u4e48\u65b9\u5f0f\u5462\uff0cSFTP\uff1fSCP\uff1fSFTP\u548cFTP\u4e0d\u5c31\u5c11\u4e86\u4e00\u4e2aS\uff0c\u5e94\u8be5\u4e5f\u9700\u8981\u5b89\u88c5FTP\u5427\uff1f_sftp scp","og_url":"https:\/\/www.wsisp.com\/helps\/16220.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T14:42:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418144253-680264ed2987e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/16220.html","url":"https:\/\/www.wsisp.com\/helps\/16220.html","name":"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T14:42:54+00:00","dateModified":"2025-04-18T14:42:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/16220.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/16220.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/16220.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668\u95f4\u8fdb\u884c\u6587\u4ef6\u4f20\u8f93-SFTP&amp;SCP\u4e00\u7bc7\u641e\u5b9a"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/16220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=16220"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/16220\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/16218"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=16220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=16220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=16220"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=16220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}