{"id":84291,"date":"2026-07-26T10:41:47","date_gmt":"2026-07-26T02:41:47","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/84291.html"},"modified":"2026-07-26T10:41:47","modified_gmt":"2026-07-26T02:41:47","slug":"linux-%e5%ae%89%e5%85%a8-%e7%a6%81%e7%94%a8%e6%95%8f%e6%84%9f%e5%91%bd%e4%bb%a4%e5%8e%86%e5%8f%b2%e8%ae%b0%e5%bd%95%e4%b8%8e%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%8a%a0%e5%9b%ba%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/84291.html","title":{"rendered":"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e"},"content":{"rendered":"<p>\u6ce8&#xff1a;\u672c\u6587\u4e3a \u201cLinux \u547d\u4ee4\u4e0e\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa\u201d \u76f8\u5173\u5408\u8f91\u3002 \u82f1\u6587\u5f15\u6587&#xff0c;\u673a\u7ffb\u672a\u6821\u3002 \u4e2d\u6587\u5f15\u6587&#xff0c;\u7565\u4f5c\u91cd\u6392\u3002 \u5982\u6709\u5185\u5bb9\u5f02\u5e38&#xff0c;\u8bf7\u770b\u539f\u6587\u3002<\/p>\n<hr \/>\n<h2>How to Prevent Passwords from Saving in Bash History<\/h2>\n<h2>\u5982\u4f55\u9632\u6b62\u5bc6\u7801\u88ab\u4fdd\u5b58\u5230 Bash \u5386\u53f2\u8bb0\u5f55\u4e2d<\/h2>\n<p>Ravi SaiveLast Updated: April 30, 2026<\/p>\n<p>Every Linux user eventually runs a command they\u2019d rather not preserve \u2013 a curl with a hardcoded password, an export with an API key, or a one-liner that would confuse any sysadmin who read it three months later. Knowing how to control what ends up in your bash history is as much a security habit as locking down SSH*. \u6bcf\u4e2a Linux \u7528\u6237\u8fdf\u65e9\u90fd\u4f1a\u6267\u884c\u4e00\u6761\u4e0d\u60f3\u88ab\u4fdd\u7559\u7684\u547d\u4ee4\u2014\u2014\u6bd4\u5982\u5e26\u786c\u7f16\u7801\u5bc6\u7801\u7684 curl \u547d\u4ee4\u3001\u542b API \u5bc6\u94a5\u7684 export \u547d\u4ee4&#xff0c;\u6216\u662f\u4e00\u6761\u4e09\u4e2a\u6708\u540e\u8ba9\u7cfb\u7edf\u7ba1\u7406\u5458\u4e00\u5934\u96fe\u6c34\u7684\u5355\u884c\u6307\u4ee4\u3002\u5b66\u4f1a\u63a7\u5236 bash \u5386\u53f2\u8bb0\u5f55\u7684\u5185\u5bb9&#xff0c;\u662f\u548c\u52a0\u56fa SSH \u540c\u7b49\u91cd\u8981\u7684\u5b89\u5168\u4e60\u60ef\u3002<\/p>\n<p>You\u2019ve probably been there: you paste a command with a password embedded, hit Enter, and immediately wonder how many places that string just landed. Bash stores every command you type in ~\/.bash_history by default, and on most systems, that file is readable by anyone who can access your account. And if you\u2019re sharing a server with other admins, that history file is the first place anyone looks when something breaks. \u4f60\u5927\u6982\u7387\u9047\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5&#xff1a;\u7c98\u8d34\u4e00\u6761\u5e26\u5bc6\u7801\u7684\u547d\u4ee4&#xff0c;\u6309\u4e0b \u56de\u8f66 \u540e\u7acb\u523b\u62c5\u5fc3\u8fd9\u6761\u654f\u611f\u5b57\u7b26\u4e32\u4f1a\u88ab\u8bb0\u5f55\u5230\u54ea\u91cc\u3002Bash \u9ed8\u8ba4\u4f1a\u628a\u4f60\u8f93\u5165\u7684\u6240\u6709\u547d\u4ee4\u4fdd\u5b58\u5230 ~\/.bash_history&#xff0c;\u5728\u5927\u591a\u6570\u7cfb\u7edf\u4e2d&#xff0c;\u4efb\u4f55\u80fd\u8bbf\u95ee\u4f60\u8d26\u6237\u7684\u4eba\u90fd\u53ef\u4ee5\u8bfb\u53d6\u8be5\u6587\u4ef6\u3002\u5982\u679c\u4f60\u548c\u5176\u4ed6\u7ba1\u7406\u5458\u5171\u7528\u4e00\u53f0\u670d\u52a1\u5668&#xff0c;\u51fa\u95ee\u9898\u65f6&#xff0c;\u5386\u53f2\u8bb0\u5f55\u6587\u4ef6\u4f1a\u662f\u7b2c\u4e00\u4e2a\u88ab\u68c0\u67e5\u7684\u5730\u65b9\u3002<\/p>\n<p>The good news is that Bash gives you precise control over what it saves, when it saves it, and how to scrub individual entries. \u597d\u6d88\u606f\u662f&#xff0c;Bash \u53ef\u4ee5\u8ba9\u4f60\u7cbe\u786e\u63a7\u5236\u4fdd\u5b58\u54ea\u4e9b\u5185\u5bb9\u3001\u4f55\u65f6\u4fdd\u5b58&#xff0c;\u4ee5\u53ca\u5982\u4f55\u6e05\u9664\u5355\u6761\u8bb0\u5f55\u3002<\/p>\n<h3>How Bash Stores Command in History<\/h3>\n<h3>Bash \u5982\u4f55\u5b58\u50a8\u547d\u4ee4\u5386\u53f2<\/h3>\n<p>Before you can control history, you need to understand when Bash writes it. For example, during a session, every command goes into an in-memory history list first. \u5728\u63a7\u5236\u5386\u53f2\u8bb0\u5f55\u4e4b\u524d&#xff0c;\u4f60\u9700\u8981\u4e86\u89e3 Bash \u4f55\u65f6\u5199\u5165\u8bb0\u5f55\u3002\u4f8b\u5982&#xff0c;\u5728\u4e00\u4e2a\u4f1a\u8bdd\u671f\u95f4&#xff0c;\u6240\u6709\u547d\u4ee4\u4f1a\u5148\u5b58\u5165\u5185\u5b58\u4e2d\u7684\u5386\u53f2\u5217\u8868\u3002<\/p>\n<p>When the session ends cleanly, that list gets appended to ~\/.bash_history on disk, which matters because if your terminal crashes or you close it with kill, nothing from that session gets saved. \u5f53\u4f1a\u8bdd\u6b63\u5e38\u7ed3\u675f\u65f6&#xff0c;\u8be5\u5217\u8868\u4f1a\u8ffd\u52a0\u5230\u78c1\u76d8\u4e0a\u7684 ~\/.bash_history \u6587\u4ef6\u4e2d\u3002\u8fd9\u4e00\u70b9\u5f88\u91cd\u8981&#xff0c;\u56e0\u4e3a\u5982\u679c\u7ec8\u7aef\u5d29\u6e83\u6216\u7528 kill \u547d\u4ee4\u5173\u95ed&#xff0c;\u672c\u6b21\u4f1a\u8bdd\u7684\u6240\u6709\u5185\u5bb9\u90fd\u4e0d\u4f1a\u88ab\u4fdd\u5b58\u3002<\/p>\n<p>The key variables that govern this behavior live in your shell environment, and you can check them right now: \u63a7\u5236\u8be5\u884c\u4e3a\u7684\u5173\u952e\u53d8\u91cf\u4f4d\u4e8e\u4f60\u7684 shell \u73af\u5883\u4e2d&#xff0c;\u4f60\u53ef\u4ee5\u7acb\u5373\u67e5\u770b&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTFILE<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTSIZE<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTFILESIZE<\/span><\/p>\n<p>Output: \u8f93\u51fa&#xff1a;<\/p>\n<p>\/home\/ravi\/.bash_history<br \/>\n1000<br \/>\n2000<\/p>\n<p>Let me explain the command output: \u6211\u6765\u89e3\u91ca\u4e00\u4e0b\u547d\u4ee4\u8f93\u51fa&#xff1a;<\/p>\n<ul>\n<li>\n<p>HISTFILE is where history gets written on exit. HISTFILE&#xff1a;\u4f1a\u8bdd\u9000\u51fa\u65f6\u5386\u53f2\u8bb0\u5f55\u5199\u5165\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<\/li>\n<li>\n<p>HISTSIZE controls how many commands the in-memory list holds per session. HISTSIZE&#xff1a;\u6bcf\u4e2a\u4f1a\u8bdd\u5728\u5185\u5b58\u4e2d\u53ef\u4fdd\u5b58\u7684\u547d\u4ee4\u6570\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>HISTFILESIZE controls how many lines the history file can grow to on disk. HISTFILESIZE&#xff1a;\u78c1\u76d8\u4e0a\u5386\u53f2\u8bb0\u5f55\u6587\u4ef6\u7684\u6700\u5927\u884c\u6570\u3002<\/p>\n<\/li>\n<\/ul>\n<p>Most distros default to 1000 in-memory and 2000 on disk, so your file keeps the last 2000 commands across all previous sessions. Understanding that gap between \u201cin memory\u201d and \u201cwritten to disk\u201d is what makes the next few techniques work cleanly. \u5927\u591a\u6570\u53d1\u884c\u7248\u9ed8\u8ba4\u5185\u5b58\u4fdd\u5b58 1000 \u6761\u3001\u78c1\u76d8\u4fdd\u5b58 2000 \u6761&#xff0c;\u56e0\u6b64\u6587\u4ef6\u4f1a\u4fdd\u7559\u6240\u6709\u4e4b\u524d\u4f1a\u8bdd\u7684\u6700\u8fd1 2000 \u6761\u547d\u4ee4\u3002\u7406\u89e3\u5185\u5b58\u4e0e\u78c1\u76d8\u5199\u5165\u4e4b\u95f4\u7684\u533a\u522b&#xff0c;\u662f\u8ba9\u540e\u7eed\u6280\u5de7\u5e72\u51c0\u751f\u6548\u7684\u5173\u952e\u3002<\/p>\n<h3>How to Prevent a Command from Being Saved in Bash History<\/h3>\n<h3>\u5982\u4f55\u9632\u6b62\u5355\u6761\u547d\u4ee4\u88ab\u4fdd\u5b58\u5230 Bash \u5386\u53f2\u8bb0\u5f55<\/h3>\n<p>The easiest way to stop Bash from saving a command in your history is surprisingly simple, just add a space before the command. \u963b\u6b62 Bash \u4fdd\u5b58\u5355\u6761\u547d\u4ee4\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u51fa\u5947\u5730\u7b80\u5355&#xff1a;\u5728\u547d\u4ee4\u524d\u52a0\u4e00\u4e2a\u7a7a\u683c\u3002<\/p>\n<p>For example, when you type a command like this, it gets saved in your history. \u4f8b\u5982&#xff0c;\u8f93\u5165\u8fd9\u6837\u7684\u547d\u4ee4\u4f1a\u88ab\u4fdd\u5b58\u5230\u5386\u53f2\u8bb0\u5f55&#xff1a;<\/p>\n<p>export API_KEY&#061;&#034;supersecretkey123&#034;<\/p>\n<p>But if you add one space at the beginning: \u4f46\u5982\u679c\u5728\u5f00\u5934\u52a0\u4e00\u4e2a\u7a7a\u683c&#xff1a;<\/p>\n<p> export API_KEY&#061;&#034;supersecretkey123&#034;<\/p>\n<p>Bash won\u2019t record this line at all, as long as HISTCONTROL includes ignorespace. \u53ea\u8981 HISTCONTROL \u5305\u542b ignorespace&#xff0c;Bash \u5c31\u5b8c\u5168\u4e0d\u4f1a\u8bb0\u5f55\u8fd9\u4e00\u884c\u3002<\/p>\n<p>So, firt check whether it\u2019s already set: \u9996\u5148\u68c0\u67e5\u5b83\u662f\u5426\u5df2\u8bbe\u7f6e&#xff1a;<\/p>\n<p>echo $HISTCONTROL<\/p>\n<p>Output: \u8f93\u51fa&#xff1a;<\/p>\n<p>ignoredups:ignorespace<\/p>\n<p>If you see ignorespace or ignoreboth in the output, you\u2019re already covered. \u5982\u679c\u8f93\u51fa\u4e2d\u5305\u542b ignorespace \u6216 ignoreboth&#xff0c;\u8bf4\u660e\u5df2\u751f\u6548\u3002<\/p>\n<p>If the variable is empty or missing, add this to your ~\/.bashrc: \u5982\u679c\u8be5\u53d8\u91cf\u4e3a\u7a7a\u6216\u4e0d\u5b58\u5728&#xff0c;\u5c06\u4ee5\u4e0b\u5185\u5bb9\u6dfb\u52a0\u5230 ~\/.bashrc&#xff1a;<\/p>\n<p>export HISTCONTROL&#061;ignorespace<\/p>\n<p>Then reload it: \u7136\u540e\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e&#xff1a;<\/p>\n<p>source ~\/.bashrc<\/p>\n<h3>Delete a Specific Command from Bash History<\/h3>\n<h3>\u4ece Bash \u5386\u53f2\u8bb0\u5f55\u4e2d\u5220\u9664\u5355\u6761\u547d\u4ee4<\/h3>\n<p>The leading-space trick only works before you run a command, but if you already ran something and want it gone, use history -d with the line number: \u5f00\u5934\u52a0\u7a7a\u683c\u7684\u6280\u5de7\u4ec5\u5728\u6267\u884c\u547d\u4ee4\u524d\u6709\u6548\u3002\u5982\u679c\u5df2\u7ecf\u6267\u884c\u5e76\u60f3\u5220\u9664&#xff0c;\u53ef\u4f7f\u7528 history -d \u52a0\u884c\u53f7&#xff1a;<\/p>\n<p>For example, first, list your bash history. \u4f8b\u5982&#xff0c;\u5148\u5217\u51fa bash \u5386\u53f2\u8bb0\u5f55&#xff1a;<\/p>\n<p>history<\/p>\n<p>Output: \u8f93\u51fa&#xff1a;<\/p>\n<p>497  sudo systemctl restart nginx<br \/>\n  498  export DB_PASS&#061;&#034;hunter2&#034;<br \/>\n  499  curl https:\/\/api.example.com\/token<br \/>\n  500  ls -la \/etc\/nginx<\/p>\n<p>To delete line 498: \u5220\u9664\u7b2c 498 \u884c&#xff1a;<\/p>\n<p>history -d 498<\/p>\n<p>Output: \u8f93\u51fa&#xff1a;<\/p>\n<p>497  sudo systemctl restart nginx<br \/>\n  499  curl https:\/\/api.example.com\/token<br \/>\n  500  ls -la \/etc\/nginx<\/p>\n<p>The entry is gone from the in-memory list, but you\u2019re not done yet. That deletion only lives in memory until the session ends. When Bash writes history to disk on exit, the gap closes, and your ~\/.bash_history file won\u2019t have the entry either, as long as you don\u2019t run history -a manually before closing the terminal. \u8be5\u6761\u76ee\u5df2\u4ece\u5185\u5b58\u5217\u8868\u4e2d\u5220\u9664&#xff0c;\u4f46\u64cd\u4f5c\u8fd8\u672a\u5b8c\u6210\u3002\u5220\u9664\u6548\u679c\u4ec5\u4fdd\u7559\u5728\u5185\u5b58\u4e2d&#xff0c;\u76f4\u5230\u4f1a\u8bdd\u7ed3\u675f\u3002\u53ea\u8981\u5173\u95ed\u7ec8\u7aef\u524d\u4e0d\u624b\u52a8\u6267\u884c history -a&#xff0c;Bash \u5728\u9000\u51fa\u5199\u5165\u78c1\u76d8\u65f6&#xff0c;~\/.bash_history \u4e2d\u4e5f\u4e0d\u4f1a\u6709\u8be5\u6761\u76ee\u3002<\/p>\n<p>If you want to scrub the on-disk file immediately without waiting for the session end, run history -w after the deletion: \u5982\u679c\u4e0d\u60f3\u7b49\u5f85\u4f1a\u8bdd\u7ed3\u675f&#xff0c;\u60f3\u7acb\u5373\u6e05\u9664\u78c1\u76d8\u6587\u4ef6&#xff0c;\u5220\u9664\u540e\u6267\u884c&#xff1a;<\/p>\n<p>history -w<\/p>\n<p>This writes the current in-memory list (without the deleted entry) directly to ~\/.bash_history, overwriting whatever was there before. \u8fd9\u4f1a\u5c06\u5f53\u524d\u5185\u5b58\u5217\u8868&#xff08;\u4e0d\u542b\u5df2\u5220\u6761\u76ee&#xff09;\u76f4\u63a5\u5199\u5165 ~\/.bash_history&#xff0c;\u8986\u76d6\u539f\u6709\u5185\u5bb9\u3002<\/p>\n<h3>Ignore Duplicate Commands in Bash History<\/h3>\n<h3>\u5728 Bash \u5386\u53f2\u8bb0\u5f55\u4e2d\u5ffd\u7565\u91cd\u590d\u547d\u4ee4<\/h3>\n<p>Repeated commands like ls, cd, clear, or git status fill up history fast and make it harder to find the commands you actually care about. \u91cd\u590d\u7684\u547d\u4ee4\u5982 ls\u3001cd\u3001clear \u6216 git status \u4f1a\u5feb\u901f\u586b\u6ee1\u5386\u53f2\u8bb0\u5f55&#xff0c;\u8ba9\u4f60\u66f4\u96be\u627e\u5230\u771f\u6b63\u9700\u8981\u7684\u547d\u4ee4\u3002<\/p>\n<p>Set HISTCONTROL to ignoredups and Bash will skip any command that matches the one immediately before it: \u5c06 HISTCONTROL \u8bbe\u7f6e\u4e3a ignoredups&#xff0c;Bash \u4f1a\u8df3\u8fc7\u4e0e\u4e0a\u4e00\u6761\u5b8c\u5168\u76f8\u540c\u7684\u547d\u4ee4&#xff1a;<\/p>\n<p>export HISTCONTROL&#061;ignoredups<\/p>\n<p>To combine both behaviors \u2013 ignore leading spaces and duplicates \u2013 use ignoreboth: \u5982\u679c\u8981\u540c\u65f6\u751f\u6548\u2014\u2014\u5ffd\u7565\u5f00\u5934\u7a7a\u683c\u548c\u91cd\u590d\u547d\u4ee4\u2014\u2014\u4f7f\u7528 ignoreboth&#xff1a;<\/p>\n<p>export HISTCONTROL&#061;ignoreboth<\/p>\n<p>Add this to your ~\/.bashrc so it persists across sessions: \u5c06\u5176\u6dfb\u52a0\u5230 ~\/.bashrc&#xff0c;\u8ba9\u914d\u7f6e\u5728\u6240\u6709\u4f1a\u8bdd\u4e2d\u6c38\u4e45\u751f\u6548&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export HISTCONTROL&#061;ignoreboth&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<br \/>\n<span class=\"token builtin class-name\">source<\/span> ~\/.bashrc<\/p>\n<h3>Stop Saving Certain Commands in Bash History<\/h3>\n<h3>\u7981\u6b62\u4fdd\u5b58\u7279\u5b9a\u7c7b\u578b\u7684\u547d\u4ee4\u5230 Bash \u5386\u53f2\u8bb0\u5f55<\/h3>\n<p>The HISTCONTROL handles the space-prefix trick and duplicates, but HISTIGNORE lets you define specific patterns that Bash always skips. Any command matching a pattern here never enters the history list at all: HISTCONTROL \u5904\u7406\u7a7a\u683c\u524d\u7f00\u548c\u91cd\u590d\u547d\u4ee4&#xff0c;\u800c HISTIGNORE \u53ef\u8ba9\u4f60\u5b9a\u4e49 Bash \u6c38\u4e45\u5ffd\u7565\u7684\u547d\u4ee4\u6a21\u5f0f\u3002\u5339\u914d\u8fd9\u4e9b\u6a21\u5f0f\u7684\u547d\u4ee4\u6839\u672c\u4e0d\u4f1a\u8fdb\u5165\u5386\u53f2\u5217\u8868&#xff1a;<\/p>\n<p>export HISTIGNORE&#061;&#034;ls:ls -la:cd:pwd:clear:history:exit&#034;<\/p>\n<p>Each pattern is separated by a colon. You can use glob-style wildcards too, so export * would suppress every export command: \u6bcf\u4e2a\u6a21\u5f0f\u7528\u5192\u53f7\u5206\u9694\u3002\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u901a\u914d\u7b26&#xff0c;\u4f8b\u5982 export * \u4f1a\u5c4f\u853d\u6240\u6709 export \u547d\u4ee4&#xff1a;<\/p>\n<p>export HISTIGNORE&#061;&#034;ls*:cd*:pwd:clear:history:export *:curl *token*&#034;<\/p>\n<p>Add it to ~\/.bashrc to make it permanent, and source the file again. Be careful not to make the patterns too broad; if you ignore sudo *, you\u2019ll lose the audit trail for every privileged command you\u2019ve ever run, which creates a different kind of problem. \u6dfb\u52a0\u5230 ~\/.bashrc \u4f7f\u5176\u6c38\u4e45\u751f\u6548&#xff0c;\u5e76\u91cd\u65b0\u52a0\u8f7d\u6587\u4ef6\u3002\u6ce8\u610f\u4e0d\u8981\u628a\u6a21\u5f0f\u8bbe\u7f6e\u5f97\u592a\u5bbd\u6cdb&#xff1b;\u5982\u679c\u5ffd\u7565 sudo *&#xff0c;\u4f60\u4f1a\u4e22\u5931\u6240\u6709\u7279\u6743\u547d\u4ee4\u7684\u5ba1\u8ba1\u8f68\u8ff9&#xff0c;\u8fd9\u4f1a\u5e26\u6765\u53e6\u4e00\u7c7b\u95ee\u9898\u3002<\/p>\n<h3>Turn Off Command History Temporarily<\/h3>\n<h3>\u4e34\u65f6\u5173\u95ed\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55<\/h3>\n<p>Sometimes you want to work on a server without leaving any trace at all such as setting up credentials, auditing a config, or doing incident response on a shared box. \u6709\u65f6\u4f60\u9700\u8981\u5728\u670d\u52a1\u5668\u4e0a\u4e0d\u7559\u4efb\u4f55\u75d5\u8ff9\u5730\u64cd\u4f5c&#xff0c;\u4f8b\u5982\u914d\u7f6e\u51ed\u8bc1\u3001\u5ba1\u8ba1\u914d\u7f6e\u6216\u5728\u5171\u4eab\u670d\u52a1\u5668\u4e0a\u5904\u7406\u5e94\u6025\u54cd\u5e94\u3002<\/p>\n<p>Set HISTFILE to \/dev\/null for the current session: \u5c06\u5f53\u524d\u4f1a\u8bdd\u7684 HISTFILE \u8bbe\u7f6e\u4e3a \/dev\/null&#xff1a;<\/p>\n<p>export HISTFILE&#061;\/dev\/null<\/p>\n<p>From that point forward in the session, nothing gets written to disk. The in-memory list still builds up (so you can use the up arrow), but when the session ends, the in-memory list evaporates instead of being flushed to a file. \u4ece\u6b64\u65f6\u8d77&#xff0c;\u672c\u6b21\u4f1a\u8bdd\u7684\u6240\u6709\u5185\u5bb9\u90fd\u4e0d\u4f1a\u5199\u5165\u78c1\u76d8\u3002\u5185\u5b58\u5217\u8868\u4ecd\u4f1a\u7d2f\u79ef&#xff08;\u56e0\u6b64\u4f60\u53ef\u4ee5\u7528\u5411\u4e0a\u7bad\u5934\u7ffb\u67e5&#xff09;&#xff0c;\u4f46\u4f1a\u8bdd\u7ed3\u675f\u65f6&#xff0c;\u5185\u5b58\u5217\u8868\u4f1a\u76f4\u63a5\u6d88\u5931&#xff0c;\u4e0d\u4f1a\u5199\u5165\u6587\u4ef6\u3002<\/p>\n<p>You can also combine this with unset HISTFILE if you want to be explicit, but pointing to \/dev\/null is the more portable approach and works the same way on every distro. \u5982\u679c\u4f60\u60f3\u66f4\u660e\u786e&#xff0c;\u4e5f\u53ef\u4ee5\u914d\u5408 unset HISTFILE \u4f7f\u7528&#xff0c;\u4f46\u6307\u5411 \/dev\/null \u662f\u66f4\u901a\u7528\u7684\u65b9\u6cd5&#xff0c;\u5728\u6240\u6709\u53d1\u884c\u7248\u4e0a\u6548\u679c\u4e00\u81f4\u3002<\/p>\n<h3>How to Clear the Entire History File<\/h3>\n<h3>\u6e05\u7a7a\u6574\u4e2a\u5386\u53f2\u8bb0\u5f55\u6587\u4ef6<\/h3>\n<p>To start clean, delete the full history file and remove all past commands. \u60f3\u4ece\u5934\u5f00\u59cb&#xff0c;\u6e05\u7a7a\u5386\u53f2\u6587\u4ef6\u5e76\u5220\u9664\u6240\u6709\u8fc7\u5f80\u547d\u4ee4&#xff1a;<\/p>\n<p>history -c &amp;&amp; history -w<\/p>\n<ul>\n<li>\n<p>history -c clears the in-memory history list for the current session. history -c&#xff1a;\u6e05\u7a7a\u5f53\u524d\u4f1a\u8bdd\u7684\u5185\u5b58\u5386\u53f2\u5217\u8868\u3002<\/p>\n<\/li>\n<li>\n<p>history -w then writes that empty list to ~\/.bash_history, overwriting the file. history -w&#xff1a;\u5c06\u7a7a\u5217\u8868\u5199\u5165 ~\/.bash_history&#xff0c;\u8986\u76d6\u6587\u4ef6\u3002<\/p>\n<\/li>\n<\/ul>\n<p>After running this, cat ~\/.bash_history returns nothing. The &amp;&amp; operator means the second command only runs if the first succeeds, so you won\u2019t accidentally clear the file mid-session if something goes wrong. \u6267\u884c\u540e&#xff0c;cat ~\/.bash_history \u4f1a\u8fd4\u56de\u7a7a\u5185\u5bb9\u3002&amp;&amp; \u8868\u793a\u7b2c\u4e00\u6761\u547d\u4ee4\u6210\u529f\u540e\u624d\u6267\u884c\u7b2c\u4e8c\u6761&#xff0c;\u907f\u514d\u51fa\u9519\u65f6\u610f\u5916\u6e05\u7a7a\u6587\u4ef6\u3002<\/p>\n<h3>Conclusion<\/h3>\n<h3>\u603b\u7ed3<\/h3>\n<p>You now have 5 distinct ways to control bash history: the leading-space trick for one-off sensitive commands, history -d for post-run cleanup, HISTCONTROL for ignoring duplicates and spaces globally, HISTIGNORE for permanent pattern-based exclusions, and HISTFILE&#061;\/dev\/null for session-wide suppression. \u73b0\u5728\u4f60\u638c\u63e1\u4e86 5 \u79cd\u63a7\u5236 Bash \u5386\u53f2\u8bb0\u5f55\u7684\u65b9\u6cd5&#xff1a;\u9488\u5bf9\u5355\u6b21\u654f\u611f\u547d\u4ee4\u7684\u5f00\u5934\u7a7a\u683c\u6280\u5de7\u3001\u6267\u884c\u540e\u6e05\u7406\u7684 history -d\u3001\u5168\u5c40\u5ffd\u7565\u91cd\u590d\u4e0e\u7a7a\u683c\u7684 HISTCONTROL\u3001\u6c38\u4e45\u6309\u6a21\u5f0f\u5c4f\u853d\u7684 HISTIGNORE&#xff0c;\u4ee5\u53ca\u5168\u4f1a\u8bdd\u7981\u7528\u7684 HISTFILE&#061;\/dev\/null\u3002<\/p>\n<p>Start with adding export HISTCONTROL&#061;ignoreboth to your ~\/.bashrc right now. Then think about what patterns belong in your HISTIGNORE. \u73b0\u5728\u5c31\u628a export HISTCONTROL&#061;ignoreboth \u6dfb\u52a0\u5230 ~\/.bashrc&#xff0c;\u7136\u540e\u601d\u8003\u54ea\u4e9b\u547d\u4ee4\u6a21\u5f0f\u5e94\u8be5\u52a0\u5165 HISTIGNORE\u3002<\/p>\n<p>If you\u2019re regularly exporting tokens or running curl with auth headers, those belong there. It takes 5 minutes and saves you from cleaning up sensitive data later. \u5982\u679c\u4f60\u7ecf\u5e38\u5bfc\u51fa\u4ee4\u724c\u6216\u6267\u884c\u5e26\u8ba4\u8bc1\u5934\u7684 curl \u547d\u4ee4&#xff0c;\u8fd9\u4e9b\u90fd\u5e94\u8be5\u52a0\u5165\u5c4f\u853d\u5217\u8868\u3002\u53ea\u9700 5 \u5206\u949f&#xff0c;\u5c31\u80fd\u907f\u514d\u540e\u7eed\u6e05\u7406\u654f\u611f\u6570\u636e\u7684\u9ebb\u70e6\u3002<\/p>\n<hr \/>\n<h2>Linux \u9632\u6b62\u5bc6\u7801\u6cc4\u9732&#xff1a;Bash \u5386\u53f2\u8bb0\u5f55\u5b89\u5168\u7ba1\u63a7 &#043; SSH \u52a0\u56fa<\/h2>\n<p>Linux \u7ec8\u7aef.bashrc \u5b89\u5168\u914d\u7f6e\u4e0e\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa&#xff1a;\u4e34\u65f6\u64cd\u4f5c \u2192 \u5355\u6b21\u89c4\u907f \u2192 \u8fdb\u9636\u64cd\u4f5c \u2192 \u5168\u5c40\u6c38\u4e45\u9632\u62a4 \u2192 \u4e8b\u540e\u8865\u6551 \u2192 SSH \u670d\u52a1\u5668\u52a0\u56fa<\/p>\n<h3>\u4e00\u3001Bash \u5386\u53f2\u8bb0\u5f55\u9632\u5bc6\u7801\u6cc4\u9732\u64cd\u4f5c<\/h3>\n<p>\u9488\u5bf9\u5bc6\u7801\u3001API \u5bc6\u94a5\u3001\u4ee4\u724c\u7b49\u654f\u611f\u547d\u4ee4&#xff0c;\u63d0\u4f9b\u4e09\u79cd\u5c42\u7ea7\u7684\u4e8b\u524d\u89c4\u907f\u65b9\u6848&#xff0c;\u6309\u9700\u9009\u7528&#xff0c;\u907f\u514d\u654f\u611f\u4fe1\u606f\u88ab\u8bb0\u5f55\u3002<\/p>\n<h4>1.1 \u5355\u6b21&#xff1a;\u547d\u4ee4\u524d\u52a0\u7a7a\u683c&#xff08;\u901a\u6cd5&#xff09;<\/h4>\n<p>Linux \u539f\u751f\u81ea\u5e26\u7684\u8f7b\u91cf\u673a\u5236&#xff0c;\u65e0\u9700\u4fee\u6539\u914d\u7f6e&#xff0c;\u4ec5\u9700\u547d\u4ee4\u5f00\u5934\u52a0 1 \u4e2a\u7a7a\u683c&#xff0c;\u547d\u4ee4\u4e0d\u4f1a\u5199\u5165\u5386\u53f2\u8bb0\u5f55\u3002<\/p>\n<h5>\u524d\u7f6e\u6761\u4ef6\u6821\u9a8c<\/h5>\n<p>\u8be5\u529f\u80fd\u4f9d\u8d56 HISTCONTROL \u53d8\u91cf&#xff0c;\u7edd\u5927\u591a\u6570\u7cfb\u7edf\u9ed8\u8ba4\u5f00\u542f&#xff0c;\u6267\u884c\u547d\u4ee4\u6821\u9a8c&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTCONTROL<\/span><\/p>\n<p>\u6b63\u5e38\u8f93\u51fa&#xff1a;ignoredups:ignorespace \/ ignoreboth&#xff0c;\u4ee3\u8868\u5df2\u751f\u6548\u3002<\/p>\n<h5>\u5b9e\u64cd\u5bf9\u6bd4<\/h5>\n<p><span class=\"token comment\"># \u4e0d\u5b89\u5168&#xff1a;\u65e0\u7a7a\u683c&#xff0c;\u547d\u4ee4\u4f1a\u88ab\u5199\u5165\u5386\u53f2\u8bb0\u5f55<\/span><br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">DB_PASS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;admin123456&#034;<\/span><br \/>\n<span class=\"token function\">curl<\/span> https:\/\/api.test.com\/token <span class=\"token parameter variable\">-u<\/span> user:pass<\/p>\n<p><span class=\"token comment\"># \u5b89\u5168&#xff1a;\u5f00\u5934\u52a0\u7a7a\u683c&#xff0c;\u5b8c\u5168\u4e0d\u8bb0\u5f55<\/span><br \/>\n <span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">DB_PASS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;admin123456&#034;<\/span><br \/>\n <span class=\"token function\">curl<\/span> https:\/\/api.test.com\/token <span class=\"token parameter variable\">-u<\/span> user:pass<\/p>\n<h5>\u672a\u5f00\u542f\u4fee\u590d&#xff08;\u6c38\u4e45\u751f\u6548&#xff09;<\/h5>\n<p>\u82e5\u8f93\u51fa\u4e3a\u7a7a&#xff0c;\u624b\u52a8\u5f00\u542f\u7a7a\u683c\u5ffd\u7565\u89c4\u5219&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export HISTCONTROL&#061;ignorespace&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<br \/>\n<span class=\"token builtin class-name\">source<\/span> ~\/.bashrc<\/p>\n<h4>1.2 \u4f1a\u8bdd&#xff1a;\u4e34\u65f6\u5173\u95ed\u5168\u5c40\u5386\u53f2\u8bb0\u5f55<\/h4>\n<p>\u9002\u7528\u4e8e\u6279\u91cf\u654f\u611f\u64cd\u4f5c\u3001\u5e94\u6025\u8fd0\u7ef4\u3001\u5171\u4eab\u670d\u52a1\u5668\u64cd\u4f5c&#xff0c;\u53ef\u5173\u95ed\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u6240\u6709\u5386\u53f2\u5199\u5165&#xff0c;\u5b9e\u73b0\u5168\u7a0b\u96f6\u7559\u5b58\u3002<\/p>\n<h5>\u539f\u7406<\/h5>\n<p>Bash \u9ed8\u8ba4\u5c06\u547d\u4ee4\u5199\u5165 ~\/.bash_history \u78c1\u76d8\u6587\u4ef6&#xff0c;\u4fee\u6539 HISTFILE \u6307\u5411\u7a7a\u8bbe\u5907&#xff0c;\u53ef\u7ec8\u6b62\u78c1\u76d8\u5199\u5165&#xff0c;\u5185\u5b58\u4ec5\u4e34\u65f6\u7f13\u5b58&#xff08;\u652f\u6301\u4e0a\u4e0b\u7bad\u5934\u7ffb\u67e5&#xff09;&#xff0c;\u4f1a\u8bdd\u5173\u95ed\u540e\u8bb0\u5f55\u81ea\u52a8\u9500\u6bc1\u3002<\/p>\n<h5>\u5b9e\u64cd\u547d\u4ee4<\/h5>\n<p><span class=\"token comment\"># \u4e34\u65f6\u5173\u95ed\u5f53\u524d\u4f1a\u8bdd\u6240\u6709\u5386\u53f2\u8bb0\u5f55\u5199\u5165<\/span><br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\"><span class=\"token environment constant\">HISTFILE<\/span><\/span><span class=\"token operator\">&#061;<\/span>\/dev\/null<\/p>\n<h5>\u8865\u5145\u8bf4\u660e<\/h5>\n<ul>\n<li>\u4ec5\u5bf9\u5f53\u524d\u7ec8\u7aef\u4f1a\u8bdd\u751f\u6548&#xff0c;\u91cd\u542f\u7ec8\u7aef\u81ea\u52a8\u6062\u590d\u9ed8\u8ba4&#xff1b;<\/li>\n<li>\u517c\u5bb9\u6240\u6709 Linux \u53d1\u884c\u7248&#xff0c;\u901a\u7528\u6027\u6781\u5f3a&#xff1b;<\/li>\n<li>\u7b49\u6548\u547d\u4ee4&#xff1a;unset HISTFILE&#xff0c;\u524d\u8005\u517c\u5bb9\u6027\u66f4\u4f18\u3002<\/li>\n<\/ul>\n<h4>1.3 \u8fdb\u9636&#xff1a;fc \u547d\u4ee4\u6279\u91cf\u7f16\u8f91\u654f\u611f\u6307\u4ee4<\/h4>\n<p>fc&#xff08;fix command&#xff09;\u4e3a Bash \u5185\u7f6e\u547d\u4ee4&#xff0c;\u65e0\u9700\u4fee\u6539\u914d\u7f6e&#xff0c;\u652f\u6301\u6279\u91cf\u7f16\u5199\u3001\u6267\u884c\u654f\u611f\u547d\u4ee4&#xff0c;\u9002\u5408\u590d\u6742\u591a\u6307\u4ee4\u654f\u611f\u64cd\u4f5c\u573a\u666f\u3002<\/p>\n<h5>\u57fa\u7840\u7528\u6cd5<\/h5>\n<p>\u6267\u884c fc \u6253\u5f00\u7cfb\u7edf\u9ed8\u8ba4\u7f16\u8f91\u5668&#xff08;nano\/vim&#xff09;&#xff0c;\u7f16\u5199\u591a\u6761\u654f\u611f\u547d\u4ee4&#xff0c;\u4fdd\u5b58\u9000\u51fa\u540e\u81ea\u52a8\u6267\u884c&#xff0c;\u65e0\u4efb\u4f55\u5386\u53f2\u8bb0\u5f55\u7559\u5b58\u3002<\/p>\n<p><span class=\"token comment\"># \u6253\u5f00\u7f16\u8f91\u5668\u7f16\u5199\u654f\u611f\u6307\u4ee4<\/span><br \/>\nfc<\/p>\n<p>\u7f16\u8f91\u5668\u5185\u793a\u4f8b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">API_KEY<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;test_secret_789&#034;<\/span><br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-X<\/span> POST https:\/\/api.test.com\/login <span class=\"token parameter variable\">-H<\/span> <span class=\"token string\">&#034;token:xxx&#034;<\/span><\/p>\n<h5>\u8fdb\u9636\u4fee\u6539\u5386\u53f2\u547d\u4ee4<\/h5>\n<p><span class=\"token comment\"># \u7f16\u8f91\u5e76\u6267\u884c\u4e0a\u4e00\u6761\u547d\u4ee4<\/span><br \/>\nfc <span class=\"token parameter variable\">-1<\/span><\/p>\n<p><span class=\"token comment\"># \u7f16\u8f91\u6307\u5b9a\u884c\u53f7\u7684\u5386\u53f2\u547d\u4ee4&#xff08;\u5148 history \u67e5\u884c\u53f7&#xff09;<\/span><br \/>\nfc <span class=\"token number\">500<\/span><\/p>\n<h5>\u529f\u80fd\u7279\u70b9<\/h5>\n<ul>\n<li>\u652f\u6301\u6279\u91cf\u7f16\u5199\u591a\u6761\u654f\u611f\u547d\u4ee4&#xff0c;\u4e00\u6b21\u6027\u6267\u884c&#xff1b;<\/li>\n<li>\u65e0\u9700\u6e05\u7a7a\u5386\u53f2\u3001\u65e0\u9700\u4fee\u6539\u73af\u5883\u53d8\u91cf&#xff0c;\u96f6\u526f\u4f5c\u7528&#xff1b;<\/li>\n<li>\u7cfb\u7edf\u539f\u751f\u5185\u7f6e&#xff0c;\u65e0\u9700\u989d\u5916\u5b89\u88c5\u4f9d\u8d56\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001Bash \u5386\u53f2\u8bb0\u5f55\u5168\u5c40\u6c38\u4e45\u5b89\u5168\u7ba1\u63a7<\/h3>\n<p>\u901a\u8fc7\u73af\u5883\u53d8\u91cf\u6c38\u4e45\u4f18\u5316\u5386\u53f2\u8bb0\u5f55\u89c4\u5219&#xff0c;\u81ea\u52a8\u8fc7\u6ee4\u91cd\u590d\u3001\u654f\u611f\u547d\u4ee4&#xff0c;\u89c4\u8303\u8bb0\u5f55\u5927\u5c0f&#xff0c;\u4ece\u6839\u6e90\u51cf\u5c11\u6cc4\u9732\u98ce\u9669&#xff0c;\u9002\u914d\u6240\u6709\u7ec8\u7aef\u4f1a\u8bdd\u3002<\/p>\n<h4>2.1 \u73af\u5883\u53d8\u91cf\u53c2\u6570\u8bf4\u660e<\/h4>\n<p><span class=\"token comment\"># \u67e5\u770b\u5386\u53f2\u6587\u4ef6\u5b58\u50a8\u8def\u5f84<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTFILE<\/span><br \/>\n<span class=\"token comment\"># \u67e5\u770b\u5355\u4f1a\u8bdd\u5185\u5b58\u6700\u5927\u4fdd\u5b58\u547d\u4ee4\u6570<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTSIZE<\/span><br \/>\n<span class=\"token comment\"># \u67e5\u770b\u78c1\u76d8\u5386\u53f2\u6587\u4ef6\u6700\u5927\u603b\u884c\u6570<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token environment constant\">$HISTFILESIZE<\/span><\/p>\n<h4>2.2 \u81ea\u52a8\u5ffd\u7565\u91cd\u590d\u547d\u4ee4<\/h4>\n<p><span class=\"token comment\"># \u4ec5\u5ffd\u7565\u8fde\u7eed\u91cd\u590d\u547d\u4ee4<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export HISTCONTROL&#061;ignoredups&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<\/p>\n<p><span class=\"token comment\"># \u540c\u65f6\u5ffd\u7565\u7a7a\u683c\u524d\u7f00\u547d\u4ee4 &#043; \u8fde\u7eed\u91cd\u590d\u547d\u4ee4<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export HISTCONTROL&#061;ignoreboth&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<br \/>\n<span class=\"token builtin class-name\">source<\/span> ~\/.bashrc<\/p>\n<h4>2.3 \u6c38\u4e45\u5c4f\u853d\u6307\u5b9a\u654f\u611f\u547d\u4ee4&#xff08;HISTIGNORE&#xff09;<\/h4>\n<p>\u81ea\u5b9a\u4e49\u9ed1\u540d\u5355&#xff0c;\u5339\u914d\u89c4\u5219\u7684\u547d\u4ee4\u76f4\u63a5\u4e0d\u8fdb\u5165\u5386\u53f2\u8bb0\u5f55&#xff0c;\u9002\u914d\u65e5\u5e38\u654f\u611f\u64cd\u4f5c\u573a\u666f\u3002<\/p>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;export HISTIGNORE&#061;&#034;ls*:cd*:pwd:clear:history:export *:curl *token*:* -u *&#034;&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<br \/>\n<span class=\"token builtin class-name\">source<\/span> ~\/.bashrc<\/p>\n<p>\u89c4\u5219\u8bf4\u660e&#xff1a;\u81ea\u52a8\u5c4f\u853d\u76ee\u5f55\u64cd\u4f5c\u3001\u6e05\u7a7a\u547d\u4ee4\u3001\u5bc6\u94a5\u5bfc\u51fa\u3001\u5e26\u5bc6\u7801 curl \u8bf7\u6c42\u7b49\u654f\u611f\u6307\u4ee4\u3002<\/p>\n<h4>2.4 \u81ea\u5b9a\u4e49\u5386\u53f2\u8bb0\u5f55\u5b58\u50a8\u5927\u5c0f<\/h4>\n<p><span class=\"token comment\"># \u5355\u4f1a\u8bdd\u5185\u5b58\u4fdd\u5b58 1000 \u6761&#xff0c;\u78c1\u76d8\u6587\u4ef6\u6700\u5927 2000 \u6761&#xff08;\u7cfb\u7edf\u9ed8\u8ba4\u53c2\u6570&#xff09;<\/span><br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\"><span class=\"token environment constant\">HISTSIZE<\/span><\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1000<\/span><br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\"><span class=\"token environment constant\">HISTFILESIZE<\/span><\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">2000<\/span><\/p>\n<h3>\u4e09\u3001\u5386\u53f2\u8bb0\u5f55\u6cc4\u9732\u4e8b\u540e\u6e05\u7406\u65b9\u6848<\/h3>\n<p>\u9488\u5bf9\u5df2\u6267\u884c\u7684\u654f\u611f\u547d\u4ee4&#xff0c;\u7cbe\u51c6\u5220\u9664\u3001\u5168\u5c40\u6e05\u7a7a\u4e24\u79cd\u8865\u6551\u65b9\u5f0f&#xff0c;\u5feb\u901f\u6d88\u9664\u6cc4\u9732\u9690\u60a3\u3002<\/p>\n<h4>3.1 \u5220\u9664\u5355\u6761\u654f\u611f\u8bb0\u5f55<\/h4>\n<p><span class=\"token comment\"># 1. \u67e5\u770b\u5386\u53f2&#xff0c;\u83b7\u53d6\u654f\u611f\u547d\u4ee4\u884c\u53f7<\/span><br \/>\n<span class=\"token function\">history<\/span><br \/>\n<span class=\"token comment\"># 2. \u5220\u9664\u6307\u5b9a\u884c&#xff08;\u793a\u4f8b&#xff1a;\u5220\u9664\u7b2c 498 \u884c&#xff09;<\/span><br \/>\n<span class=\"token function\">history<\/span> <span class=\"token parameter variable\">-d<\/span> <span class=\"token number\">498<\/span><br \/>\n<span class=\"token comment\"># 3. \u7acb\u5373\u540c\u6b65\u81f3\u78c1\u76d8&#xff0c;\u5f7b\u5e95\u6e05\u9664<\/span><br \/>\n<span class=\"token function\">history<\/span> <span class=\"token parameter variable\">-w<\/span><\/p>\n<h4>3.2 \u6e05\u7a7a\u5168\u90e8\u5386\u53f2\u8bb0\u5f55<\/h4>\n<p><span class=\"token comment\"># \u6e05\u7a7a\u5185\u5b58\u8bb0\u5f55 &#043; \u8986\u76d6\u78c1\u76d8\u6587\u4ef6&#xff0c;\u6e05\u7a7a\u6240\u6709\u5386\u53f2\u8bb0\u5f55<\/span><br \/>\n<span class=\"token function\">history<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">history<\/span> <span class=\"token parameter variable\">-w<\/span><\/p>\n<h3>\u56db\u3001SSH \u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa<\/h3>\n<p>\u7ec8\u7aef\u5386\u53f2\u8bb0\u5f55\u9632\u6cc4\u9732\u4e3a\u524d\u7f6e\u9632\u62a4&#xff0c;SSH \u52a0\u56fa\u53ef\u63d0\u5347\u670d\u52a1\u5668\u5b89\u5168\u80fd\u529b&#xff0c;\u964d\u4f4e\u5bc6\u7801\u3001\u5bc6\u94a5\u6cc4\u9732\u5f15\u53d1\u7684\u5165\u4fb5\u98ce\u9669\u3002<\/p>\n<h4>4.1 \u5b89\u5168\u914d\u7f6e\u9879<\/h4>\n<p><span class=\"token comment\"># \u7f16\u8f91 SSH \u914d\u7f6e\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">vim<\/span> \/etc\/ssh\/sshd_config<\/p>\n<p>\u5199\u5165\u4ee5\u4e0b\u5b89\u5168\u914d\u7f6e&#xff08;\u76f4\u63a5\u5168\u8986\u76d6&#xff09;&#xff1a;<\/p>\n<p># \u7981\u6b62 root \u8d85\u7ea7\u7528\u6237\u8fdc\u7a0b\u767b\u5f55<br \/>\nPermitRootLogin no<br \/>\n# \u5173\u95ed\u5bc6\u7801\u767b\u5f55&#xff0c;\u4ec5\u5141\u8bb8\u5bc6\u94a5\u767b\u5f55<br \/>\nPasswordAuthentication no<br \/>\nChallengeResponseAuthentication no<br \/>\n# \u81ea\u5b9a\u4e49\u5141\u8bb8\u767b\u5f55\u7684\u666e\u901a\u7528\u6237\u540d&#xff08;\u66ff\u6362\u4e3a\u81ea\u5df1\u7684\u7528\u6237\u540d&#xff09;<br \/>\nAllowUsers \u81ea\u5b9a\u4e49\u7528\u6237\u540d<br \/>\n# \u53ef\u9009&#xff1a;\u4fee\u6539\u9ed8\u8ba4 22 \u7aef\u53e3&#xff08;1024-65535&#xff09;&#xff0c;\u89c4\u907f\u66b4\u529b\u626b\u63cf<br \/>\nPort 2222<\/p>\n<h4>4.2 \u91cd\u542f\u670d\u52a1\u751f\u6548<\/h4>\n<p><span class=\"token function\">sudo<\/span> systemctl restart sshd<\/p>\n<h4>4.3 \u5bc6\u94a5\u767b\u5f55\u66ff\u4ee3\u5bc6\u7801<\/h4>\n<p><span class=\"token comment\"># \u751f\u6210 ed25519 \u5bc6\u94a5&#xff0c;RSA \u4e4b\u5916\u7684\u53ef\u9009\u5bc6\u94a5\u7c7b\u578b<\/span><br \/>\nssh-keygen <span class=\"token parameter variable\">-t<\/span> ed25519<br \/>\n<span class=\"token comment\"># \u5c06\u516c\u94a5\u63a8\u9001\u81f3\u8fdc\u7a0b\u670d\u52a1\u5668&#xff0c;\u5b9e\u73b0\u514d\u5bc6\u767b\u5f55<\/span><br \/>\nssh-copy-id \u7528\u6237\u540d&#064;\u670d\u52a1\u5668IP<\/p>\n<h3>\u4e94\u3001\u5b89\u5168\u914d\u7f6e\u811a\u672c\u90e8\u7f72<\/h3>\n<p>\u6240\u6709 Bash \u5386\u53f2\u8bb0\u5f55\u5b89\u5168\u914d\u7f6e&#xff0c;\u6267\u884c\u540e\u6c38\u4e45\u751f\u6548&#xff0c;\u65e0\u9700\u9010\u6761\u624b\u52a8\u914d\u7f6e\u3002<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># Bash \u5386\u53f2\u8bb0\u5f55\u5b89\u5168\u52a0\u56fa\u4e00\u952e\u811a\u672c<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#039;<br \/>\n# \u540c\u65f6\u5ffd\u7565\u7a7a\u683c\u524d\u7f00\u3001\u91cd\u590d\u547d\u4ee4<br \/>\nexport HISTCONTROL&#061;ignoreboth<br \/>\n# \u5c4f\u853d\u65e5\u5e38\u654f\u611f\u3001\u5197\u4f59\u547d\u4ee4<br \/>\nexport HISTIGNORE&#061;&#034;ls*:cd*:pwd:clear:history:export *:curl *token*:* -u *&#034;<br \/>\n# \u89c4\u8303\u5386\u53f2\u8bb0\u5f55\u5b58\u50a8\u5927\u5c0f<br \/>\nexport HISTSIZE&#061;1000<br \/>\nexport HISTFILESIZE&#061;2000<br \/>\n&#039;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.bashrc<\/p>\n<p><span class=\"token comment\"># \u91cd\u8f7d\u914d\u7f6e\u7acb\u5373\u751f\u6548<\/span><br \/>\n<span class=\"token builtin class-name\">source<\/span> ~\/.bashrc<br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;Bash \u5386\u53f2\u8bb0\u5f55\u5b89\u5168\u914d\u7f6e\u90e8\u7f72\u5b8c\u6210&#xff01;&#034;<\/span><\/p>\n<h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<li>\u5355\u6b21\u64cd\u4f5c&#xff1a;\u547d\u4ee4\u524d\u52a0\u7a7a\u683c&#xff0c;\u9002\u914d\u4e34\u65f6\u5355\u6761\u654f\u611f\u6307\u4ee4\u573a\u666f&#xff1b;<\/li>\n<li>\u5168\u4f1a\u8bdd&#xff1a;export HISTFILE&#061;\/dev\/null&#xff0c;\u4e34\u65f6\u5173\u95ed\u6240\u6709\u5386\u53f2\u5199\u5165&#xff1b;<\/li>\n<li>\u6279\u91cf\u64cd\u4f5c&#xff1a;fc \u547d\u4ee4\u7f16\u8f91\u6267\u884c\u6307\u4ee4&#xff0c;\u65e0\u8bb0\u5f55\u7559\u5b58&#xff1b;<\/li>\n<li>\u5168\u5c40\u6c38\u4e45\u9632\u62a4&#xff1a;HISTCONTROL &#043; HISTIGNORE \u81ea\u52a8\u8fc7\u6ee4\u5197\u4f59\u3001\u654f\u611f\u8bb0\u5f55&#xff1b;<\/li>\n<li>\u4e8b\u540e\u8865\u6551\u6e05\u7406&#xff1a;history -d \u7cbe\u51c6\u5220\u8bb0\u5f55&#xff0c;history -c \u5168\u5c40\u6e05\u7a7a&#xff1b;<\/li>\n<li>\u670d\u52a1\u5668\u5b89\u5168\u9632\u62a4&#xff1a;SSH \u7981\u7528\u5bc6\u7801\/root \u767b\u5f55&#xff0c;\u5bc6\u94a5\u767b\u5f55\u53ef\u62b5\u5fa1\u66b4\u529b\u7834\u89e3\u3002<\/li>\n<hr \/>\n<h2>reference<\/h2>\n<ul>\n<li>How to Keep Passwords Out of Bash History on Linux https:\/\/www.tecmint.com\/hide-commands-bash-history-linux\/<\/li>\n<li>\u2026<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6ce8&#xff1a;\u672c\u6587\u4e3a \u201cLinux \u547d\u4ee4\u4e0e\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa\u201d \u76f8\u5173\u5408\u8f91\u3002 \u82f1\u6587\u5f15\u6587&#xff0c;\u673a\u7ffb\u672a\u6821\u3002 \u4e2d\u6587\u5f15\u6587&#xff0c;\u7565\u4f5c\u91cd\u6392\u3002 \u5982\u6709\u5185\u5bb9\u5f02\u5e38&#xff0c;\u8bf7\u770b\u539f\u6587\u3002 How to Prevent Passwords from Saving in Bash History<br \/>\n\u5982\u4f55\u9632\u6b62\u5bc6\u7801\u88ab\u4fdd\u5b58\u5230 Bash \u5386\u53f2\u8bb0\u5f55\u4e2d<br \/>\nRavi SaiveLast Updated: April 30, 2026<br \/>\nEvery Linux user eventually r<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9436],"topic":[],"class_list":["post-84291","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux-"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \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\/84291.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6ce8&#xff1a;\u672c\u6587\u4e3a \u201cLinux \u547d\u4ee4\u4e0e\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa\u201d \u76f8\u5173\u5408\u8f91\u3002 \u82f1\u6587\u5f15\u6587&#xff0c;\u673a\u7ffb\u672a\u6821\u3002 \u4e2d\u6587\u5f15\u6587&#xff0c;\u7565\u4f5c\u91cd\u6392\u3002 \u5982\u6709\u5185\u5bb9\u5f02\u5e38&#xff0c;\u8bf7\u770b\u539f\u6587\u3002 How to Prevent Passwords from Saving in Bash History \u5982\u4f55\u9632\u6b62\u5bc6\u7801\u88ab\u4fdd\u5b58\u5230 Bash \u5386\u53f2\u8bb0\u5f55\u4e2d Ravi SaiveLast Updated: April 30, 2026 Every Linux user eventually r\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/84291.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-26T02:41:47+00:00\" \/>\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=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/84291.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/84291.html\",\"name\":\"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-26T02:41:47+00:00\",\"dateModified\":\"2026-07-26T02:41:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/84291.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/84291.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/84291.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e\"}]},{\"@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":"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \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\/84291.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6ce8&#xff1a;\u672c\u6587\u4e3a \u201cLinux \u547d\u4ee4\u4e0e\u670d\u52a1\u5668\u5b89\u5168\u52a0\u56fa\u201d \u76f8\u5173\u5408\u8f91\u3002 \u82f1\u6587\u5f15\u6587&#xff0c;\u673a\u7ffb\u672a\u6821\u3002 \u4e2d\u6587\u5f15\u6587&#xff0c;\u7565\u4f5c\u91cd\u6392\u3002 \u5982\u6709\u5185\u5bb9\u5f02\u5e38&#xff0c;\u8bf7\u770b\u539f\u6587\u3002 How to Prevent Passwords from Saving in Bash History \u5982\u4f55\u9632\u6b62\u5bc6\u7801\u88ab\u4fdd\u5b58\u5230 Bash \u5386\u53f2\u8bb0\u5f55\u4e2d Ravi SaiveLast Updated: April 30, 2026 Every Linux user eventually r","og_url":"https:\/\/www.wsisp.com\/helps\/84291.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-26T02:41:47+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/84291.html","url":"https:\/\/www.wsisp.com\/helps\/84291.html","name":"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-26T02:41:47+00:00","dateModified":"2026-07-26T02:41:47+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/84291.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/84291.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/84291.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux \u5b89\u5168 | \u7981\u7528\u654f\u611f\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\u4e0e\u670d\u52a1\u5668\u52a0\u56fa\u914d\u7f6e"}]},{"@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\/84291","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=84291"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/84291\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=84291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=84291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=84291"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=84291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}