{"id":250736,"date":"2022-08-29T09:26:11","date_gmt":"2022-08-29T01:26:11","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=250736"},"modified":"2022-08-22T14:27:33","modified_gmt":"2022-08-22T06:27:33","slug":"linux-login-shell","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-login-shell.html","title":{"rendered":"Linux \u4e2d\u7684\u767b\u5f55 Shell\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u60a8\u53ef\u80fd\u542c\u8bf4\u8fc7\u767b\u5f55 shell \u548c\u975e\u767b\u5f55 shell \u4e4b\u95f4\u7684\u533a\u522b\u3002\u867d\u7136\u4e00\u5f00\u59cb\u53ef\u80fd\u4e0d\u90a3\u4e48\u660e\u663e\uff0c\u4f46\u4e24\u79cd shell \u7c7b\u578b\u4e4b\u95f4\u5b58\u5728\u4e00\u4e9b\u5dee\u5f02\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u5f53\u7528\u6237\u767b\u5f55\u5230\u4ed6\u4eec\u7684\u5e10\u6237\u65f6\uff0cLinux \u4f1a\u542f\u52a8\u4e00\u4e2a\u767b\u5f55 shell\u3002\u90a3\u4e48\u4ec0\u4e48\u662f\u767b\u5f55 shell\uff0c\u4f60\u600e\u4e48\u77e5\u9053\u4f60\u662f\u5426\u6b63\u5728\u8fd0\u884c\u5462\uff1f<\/p>\n

\u60a8\u53ef\u80fd\u6bcf\u5929\u90fd\u5728\u4f7f\u7528 Linux shell\uff0c\u4f46\u662f\u60a8\u5982\u4f55\u4f7f\u7528\u5b83\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u51b3\u5b9a\u4e86\u5b83\u7684\u884c\u4e3a\u3002\u60a8\u53ef\u80fd\u542c\u8bf4\u8fc7\u767b\u5f55 shell \u548c\u975e\u767b\u5f55 shell \u4e4b\u95f4\u7684\u533a\u522b\u3002\u867d\u7136\u4e00\u5f00\u59cb\u53ef\u80fd\u4e0d\u90a3\u4e48\u660e\u663e\uff0c\u4f46\u4e24\u79cd shell \u7c7b\u578b\u4e4b\u95f4\u5b58\u5728\u4e00\u4e9b\u5dee\u5f02\u3002<\/p>\n

\u8fd9\u662f\u60a8\u9700\u8981\u4e86\u89e3\u7684\u6709\u5173 Linux \u4e0a\u767b\u5f55 shell \u7684\u6240\u6709\u4fe1\u606f\u3002<\/p>\n

\u4ec0\u4e48\u662f\u767b\u5f55 Shell\uff1f<\/strong><\/div>\n

\u767b\u5f55 shell \u5c31\u662f\u8fd9\u6837\uff1a\u5f53\u4f60\u76f4\u63a5\u767b\u5f55\u5230 Linux \u673a\u5668\u65f6\u542f\u52a8\u7684 shell\u3002\u5f53\u60a8\u4ece\u865a\u62df\u63a7\u5236\u53f0\u6216\u901a\u8fc7 SSH \u767b\u5f55\u7cfb\u7edf\u65f6\uff0c\u542f\u52a8\u7684 shell \u662f\u767b\u5f55 shell\u3002<\/p>\n

\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u5982\u679c\u60a8\u542f\u52a8\u7ec8\u7aef\u7a97\u53e3\uff0c\u5219\u8be5 shell \u4f1a\u8bdd\u901a\u5e38\u4e0d\u662f\u767b\u5f55 shell\u3002\u5f53\u60a8\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u952e\u5165 shell \u7684\u540d\u79f0\u6765\u542f\u52a8\u5b50 shell \u65f6\u4e5f\u662f\u5982\u6b64\u3002\u8fd9\u4e2a shell \u53ea\u662f\u4e00\u4e2a\u4ea4\u4e92\u5f0f shell\u3002<\/p>\n

\u4e24\u8005\u4e4b\u95f4\u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e shelll \u7684\u884c\u4e3a\u3002shell \u901a\u5e38\u53ea\u4f1a\u5728\u542f\u52a8\u65f6\u8bfb\u53d6\u67d0\u4e9b\u6587\u4ef6\u3002\u53ea\u6709\u5728\u4f5c\u4e3a\u767b\u5f55 shell \u8c03\u7528\u65f6\uff0cBash \u624d\u4f1a\u8bfb\u53d6\u60a8\u7684\u4e3b\u76ee\u5f55\u4e2d\u7684\/etc\/profile\u3001.bash_profile\u3001.bash_login\u548c.profile \u6587\u4ef6\u3002<\/p>\n

\u5982\u4f55\u5224\u65ad\u60a8\u662f\u5426\u6b63\u5728\u4f7f\u7528\u767b\u5f55 Shell<\/strong><\/div>\n

\u5f88\u5bb9\u6613\u770b\u51fa\u60a8\u662f\u5426\u6b63\u5728\u8fd0\u884c\u767b\u5f55 shell\u3002\u5982\u679c\u60a8\u4ece\u684c\u9762\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u4e86\u60a8\u7684 shell\uff0c\u90a3\u4e48\u60a8\u5f88\u53ef\u80fd\u4e0d\u4f1a\uff0c\u9664\u975e\u60a8\u5728\u53e6\u4e00\u4e2a\u7ec8\u7aef\u73af\u5883\u4e2d\uff0c\u4f8b\u5982 WSL \u6216 macOS \u7ec8\u7aef\u3002<\/p>\n

\u60a8\u53ef\u4ee5\u4f7f\u7528\u6b64\u547d\u4ee4\u68c0\u67e5\u60a8\u662f\u5426\u6b63\u5728\u8fd0\u884c\u767b\u5f55 shell\uff1b<\/p>\n

\r\necho $0\r\n<\/pre>\n

\"\"<\/p>\n

\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u767b\u5f55 Shell \uff0c\u60a8\u5c06\u770b\u5230 shell \u7684\u540d\u79f0\u524d\u9762\u6709\u4e00\u4e2a\u8fde\u5b57\u7b26 ( \u2013 )\u3002\u5982\u679c\u6ca1\u6709\uff0c\u60a8\u53ea\u4f1a\u770b\u5230 shell \u7684\u540d\u79f0\u3002<\/p>\n

\u5728 Linux \u4e0a\u8bbe\u7f6e\u767b\u5f55 Shell<\/strong><\/div>\n

\u8981\u8bbe\u7f6e\u60a8\u7684\u767b\u5f55 shell\uff0c\u8bf7\u4f7f\u7528 chsh \u547d\u4ee4\u3002\u60a8\u53ef\u4ee5\u5c06\u767b\u5f55 shell \u8bbe\u7f6e\u4e3a\/etc\/shells\u4e2d\u5217\u51fa\u7684\u4efb\u4f55 shell \u7684\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n

\u8981\u5c06\u4efb\u4f55 shell \u4f5c\u4e3a\u767b\u5f55 shell \u542f\u52a8\uff0c\u901a\u5e38\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u9009\u9879\u3002\u4f8b\u5982\uff0c\u8981\u5c06 Bash \u4f5c\u4e3a\u767b\u5f55 shell \u542f\u52a8\uff1a<\/p>\n

\r\nbash --login\r\n<\/pre>\n

\"\"<\/p>\n

\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f Linux \u684c\u9762\uff0c\u60a8\u901a\u5e38\u53ef\u4ee5\u6307\u5b9a\u5728\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\u65f6\u8fd0\u884c\u54ea\u4e2a\u547d\u4ee4\u3002\u5982\u679c\u4f60\u60f3\u8ba9\u4f60\u7684 shell \u4f5c\u4e3a\u767b\u5f55 shell \u8fd0\u884c\uff0c\u4f60\u53ef\u4ee5\u628a\u90a3\u4e2a\u9009\u9879\u653e\u5728\u90a3\u91cc\u3002<\/p>\n

\u73b0\u5728\u60a8\u4e86\u89e3\u767b\u5f55 Shell<\/strong><\/div>\n

\u60a8\u73b0\u5728\u5e94\u8be5\u4e86\u89e3\u4ec0\u4e48\u662f\u767b\u5f55 shell\u3002\u76f4\u63a5\u4ece\u63a7\u5236\u53f0\u6216\u4ece\u7ec8\u7aef\u7a97\u53e3\u542f\u52a8\u60a8\u7684 shell \u5c06\u786e\u5b9a\u5b83\u7684\u884c\u4e3a\u65b9\u5f0f\u3002<\/p>\n

\u5982\u679c\u60a8\u662f Linux \u65b0\u624b\uff0c\u60a8\u53ef\u80fd\u60f3\u77e5\u9053\u54ea\u4e2a shell \u6700\u597d\u3002\u60a8\u53ef\u4ee5\u575a\u6301\u4f7f\u7528\u9ed8\u8ba4\u7684 Bash\uff0c\u4e5f\u53ef\u4ee5\u63a2\u7d22\u5176\u4ed6 shell\uff08\u5982 Fish \u6216 Zsh\uff09\u63d0\u4f9b\u7684\u7279\u6b8a\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5f53\u7528\u6237\u767b\u5f55\u5230\u4ed6\u4eec\u7684\u5e10\u6237\u65f6\uff0cLinux \u4f1a\u542f\u52a8\u4e00\u4e2a\u767b\u5f55 shell\u3002\u90a3\u4e48\u4ec0\u4e48\u662f\u767b\u5f55 shell\uff0c\u4f60\u600e\u4e48\u77e5\u9053\u4f60\u662f\u5426 […]<\/p>\n","protected":false},"author":317,"featured_media":210777,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-250736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/250736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=250736"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/250736\/revisions"}],"predecessor-version":[{"id":250742,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/250736\/revisions\/250742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/210777"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=250736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=250736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=250736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}