LoginSignup
0
1

More than 5 years have passed since last update.

Raspberry Pi3 Model Bのセットアップ2

Last updated at Posted at 2018-08-20

前回の続きです.

ユーザーの作成

piユーザーのままでは危険だし何か気に入らないので新しく追加します.

まずrootに切り替えます
# sudo su -

hogeユーザーを追加します
$ adduser hoge

sudoを使えるようにします
$ sudo gpasswd -a hoge sudo

SSH configの設定

$ ssh raspberry

で入れるようにします.

Mac
Macのターミナルで作業します

.sshディレクトリに移動します
$ cd ~/.ssh

sshを作成します
$ ssh-keygen -t rsa -f raspberry

公開鍵をコピーします
$ cat raspberry.pub | pbcopy
Raspberry
.sshディレクトリに移動します
$ cd ~/.ssh

$ touch authorized_keys

$ vim authorized_keys

先ほどコピーした公開鍵を貼り付けます

Mac
$ cd ~/.ssh
$ vim config
Host raspberry
  HostName 192.168.1.8
  Port 22
  User hoge
  Protocol 2
  IdentityFile ~/.ssh/raspberry

を貼り付け保存します

Mac
$ ssh raspberry

で入れるか確認します

zsh & oh-my-zsh

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install zsh
$ which zsh 
$ chsh
# https://github.com/robbyrussell/oh-my-zsh
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
0
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
0
1