<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ssh - Tag - Mulinux | Linux &amp; DevOps Notes</title>
    <link>https://blog.mulinux.com/en/tags/ssh/</link>
    <description>Mulinux - Linux Operations &amp; DevOps blog. Notes on Linux, Kubernetes, Docker and backend engineering.</description>
    <generator>Hugo 0.160.0 &amp; FixIt v0.4.5</generator>
    <language>en</language>
    <lastBuildDate>Wed, 17 Feb 2016 10:17:30 +0800</lastBuildDate>
    <atom:link href="https://blog.mulinux.com/en/tags/ssh/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>禁止root登录，su&amp;sudo用户身份切换到user1登录</title>
      <link>https://blog.mulinux.com/en/set-permitrootlogin-sudo/</link>
      <pubDate>Wed, 17 Feb 2016 10:17:30 +0800</pubDate>
      <guid>https://blog.mulinux.com/en/set-permitrootlogin-sudo/</guid>
      <category domain="https://blog.mulinux.com/en/categories/operations/">Operations</category>
      <description>&lt;h2 class=&#34;heading-element&#34; id=&#34;禁止root登录&#34;&gt;&lt;span&gt;禁止root登录&lt;/span&gt;&#xA;  &lt;a href=&#34;#%e7%a6%81%e6%ad%a2root%e7%99%bb%e5%bd%95&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;pre&gt;&lt;code&gt;vim /etc/ssh/sshd_config 加入一行：&#xA;PermitRootLogin no&lt;/code&gt;&lt;/pre&gt;&lt;h2 class=&#34;heading-element&#34; id=&#34;切换到user1登录&#34;&gt;&lt;span&gt;切换到user1登录&lt;/span&gt;&#xA;  &lt;a href=&#34;#%e5%88%87%e6%8d%a2%e5%88%b0user1%e7%99%bb%e5%bd%95&#34; class=&#34;heading-mark&#34;&gt;&#xA;    &lt;svg class=&#34;octicon octicon-link&#34; viewBox=&#34;0 0 16 16&#34; version=&#34;1.1&#34; width=&#34;16&#34; height=&#34;16&#34; aria-hidden=&#34;true&#34;&gt;&lt;path d=&#34;m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&lt;pre&gt;&lt;code&gt;su - 用来初始化环境变量 $PATH $HOME等&#xA;sudo su到root需要输入root的密码不安全&#xA;visudo 编辑/etc/sudoers 配置文件 没有命令需安装 yum install -y sudo&#xA;格式： user host=(as_user) commands&#xA;比如： user1 ALL=(ALL) NOPASSWD: SU //它的意思是，让user1这个普通用户，拥有root的权限&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
