1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【ユーザー名の変更】Raspberry pi 初期設定

Last updated at Posted at 2021-12-05

初期設定ではユーザー名がpiになっている。
セキュリティーを強化するために,ユーザー名とパスワードの変更を行う。

参考
https://monoist.itmedia.co.jp/mn/articles/1912/11/news022.html

  1. ユーザー名を作成する。

    sudo adduser newuser

    newuserのパスワードの設定をする。
  2. 『pi』と同じ権限を『newuser』に付与する。

     piの権限を見る。

    groups pi

    権限をnewuserに付与する。

    sudo usermod -G pi,adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio newuser
  3. 『pi』の中身のファイルを『newuser』移動

    sudo cp -r /home/pi/* /home/newuser
  4. Rebootし,『newuser』でログイン
  5. 『pi』ユーザーの削除

    sudo userdel pi

一言
Raspberry piは自由度が高いが故に,自身で設定する部分が多い。
Raspberry piをネットにつなぐことが多いので,購入時にセキュリティー設定を済ませておきたい。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?