2
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?

RasberryPiにSSHしたら日本語が文字化けたので修正した

Posted at

sshをしたら?????????ばっかりでなんも読めない...

調べると以下の手順が出てきました!
n番煎じかもしれませんが作業記録です

ラズパイのデフォルトロケールをja_JP.UTF-8にする

以下の記事を参考に修正しました!
ありがとうございます

$ sudo vi /etc/ssh/sshd_config

# 以下を追加
LANG="ja_JP.UTF-8"
LC_CTYPE="ja_JP.UTF-8"
LC_ALL="ja_JP.UTF-8"
$ sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
  ja_JP.UTF-8... done
Generation complete.
*** update-locale: Error: invalid locale settings:  LANG=ja_JP.UTF-8 LANGUAGE=ja_JP.EUC-JP LC_ALL=ja_JP.EUC-JP

locale設定と競合してしまう...
修正しましょう

ローカル設定を修正

sudo vi /etc/default/locale

自分の場合ja_JP.EUC-JPになってたのでja_JP.UTF-8に修正しました

LANG="ja_JP.UTF-8"
LANGUAGE="ja_JP.UTF-8"
LC_ALL="ja_JP.UTF-8"

日本語が写りました!

$ ls
Desktop  document  download  image  music  public  template  video  ダウンロード  ドキュメント
2
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
2
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?