<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>golang</author_name>
  <author_url>https://blog.hatena.ne.jp/golang/</author_url>
  <blog_title>golangの日記</blog_title>
  <blog_url>https://golang.hateblo.jp/</blog_url>
  <categories>
    <anon>Go言語</anon>
  </categories>
  <description>exec.Command で sudo のパスワードを Stdin から入力 package main import ( &quot;fmt&quot; &quot;os&quot; &quot;os/exec&quot; &quot;strings&quot; ) func main() { command := []string{&quot;sudo&quot;, &quot;-S&quot;, &quot;chown&quot;, &quot;-R&quot;, &quot;root:root&quot;, &quot;foo.txt&quot;} cmd := exec.Command(command[0], command[1:]...) // Stdinからパスワードを入力 cmd.Stdin = strings.NewReader(&quot;PASSWORD&quot; + &quot;\n&quot;) cmd…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgolang.hateblo.jp%2Fentry%2Fcommand-input-password&quot; title=&quot;Go言語 sudo のパスワードを Stdin から入力する - golangの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/g/golang/20221023/20221023194611.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-10-22 21:00:15</published>
  <title>Go言語 sudo のパスワードを Stdin から入力する</title>
  <type>rich</type>
  <url>https://golang.hateblo.jp/entry/command-input-password</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
