{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/debian-buster/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/debian-buster/", "feed_url": "https://matoken.org/blog/tag/debian-buster/feed/json/", "language": "ja", "title": "Debian buster – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "http://matoken.org/blog/?p=2420", "url": "https://matoken.org/blog/2019/07/11/apt-update-after-releasing-debian-10-buster-testing-results-in-an-error/", "title": "Debian 10 Buster testing \u3092\u30ea\u30ea\u30fc\u30b9\u5f8c\u306b apt update \u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b", "content_html": "
2019-07-06 \u306b Debian Buster 10 \u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\uff0e
\nDebian 10 Buster testing \u74b0\u5883\u3067\u30ea\u30ea\u30fc\u30b9\u5f8c\u306b apt update \u3092\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\uff0e
$ sudo apt update\r\nGet:1 http://security.debian.org/debian-security buster/updates InRelease [39.1 kB]\r\nGet:2 http://deb.debian.org/debian buster InRelease [118 kB]\r\nN: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Version' value from '' to '10'\r\nE: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'testing' to 'stable'\r\nN: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.\r\nDo you want to accept these changes and continue updating from this repository? [y/N]\r\nN: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Version' value from '' to '10.0'\r\nE: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'testing' to 'stable'\r\nN: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.\r\nDo you want to accept these changes and continue updating from this repository? [y/N]\r\nReading package lists... Done\r\nE: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease\r\nE: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease\r\nE: Some index files failed to download. They have been ignored, or old ones used instead.\n
--allow-releaseinfo-change \u3092\u6307\u5b9a\u3057\u3066APT \u306b\u30ea\u30ea\u30fc\u30b9\u3092\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u305f\u3053\u3068\u3092\u6559\u3048\u307e\u3059\uff0e
$ sudo apt --allow-releaseinfo-change update\n
\u6b21\u304b\u3089\u306f\u30aa\u30d7\u30b7\u30e7\u30f3\u7121\u3057\u3067\u5b9f\u884c\u3057\u3066\u3082\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u304f\u306a\u308a\u307e\u3059\uff0e
\n$ sudo apt update\r\nHit:1 http://deb.debian.org/debian buster InRelease\r\nHit:2 http://security.debian.org/debian-security buster/updates InRelease\r\nReading package lists... Done\r\nBuilding dependency tree\r\nReading state information... Done\r\n3 packages can be upgraded. Run 'apt list --upgradable' to see them.\n
\u3061\u306a\u307f\u306b stable \u3067\u306a\u304f testing \u74b0\u5883\u3092\u4f7f\u3044\u7d9a\u3051\u305f\u3044\u5834\u5408\u306f /etc/apt/sources.list \u3092\u73fe\u5728\u306e Debian testing \u306e bullseye \u306b\u4fee\u6b63\u3059\u308c\u3070\u3044\u3044\u306f\u305a\uff0e
$ dpkg-query -W apt\r\napt 1.8.2\r\n$ hostnamectl | egrep 'Operating System|Architecture'\r\n Operating System: Debian GNU/Linux 10 (buster)\r\n Architecture: x86-64\n
Debian \u306e linux 4.8.0 \u4ee5\u964d\u3067\u4e00\u822c\u30e6\u30fc\u30b6\u306b\u3088\u308b dmesg \u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u306e\u3067\uff0ckernel\u30d1\u30e9\u30e1\u30fc\u30bf\u306e kernel.dmesg_restrict \u3092\u4fee\u6b63\u3057\u3066 dmesg command \u3092\u4e00\u822c\u30e6\u30fc\u30b6\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u304c\u3053\u308c\u3060\u3068\u5168\u30e6\u30fc\u30b6\u3067\u5b9f\u884c\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\uff0esudo \u3092\u8a2d\u5b9a\u3057\u3066\u30ed\u30b0\u306e\u8aad\u3081\u308b adm \u30e6\u30fc\u30b6\u3060\u3051\u304c dmesg command \u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\uff0e
dmesg\u3092\u5b9f\u884c\u3057\u305f\u3044\u30e6\u30fc\u30b6\u3092adm group \u306b\u767b\u9332\u3059\u308b(login\u3057\u76f4\u3057\u3066\u53cd\u6620\u3057\u3066\u304a\u304f)
$ sudo addgroup matoken adm\r\n$ exit\r\n\nvisudo command \u3067 /etc/sudoers \u3092\u7de8\u96c6\u3057\u3066 adm group \u306f NOPASSWD \u3067 dmesg command \u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b(\u5ff5\u306e\u70ba\u7de8\u96c6\u524d\u306b\u3082\u30461\u679a\u7aef\u672b\u3092\u958b\u3044\u3066 sudo -s \u3057\u3066\u304a\u3044\u305f\u308a\uff0cat\u7b49\u30675\u5206\u5f8c\u306b /etc/sudoers \u3092\u5dfb\u304d\u623b\u3059\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u30df\u30b9\u3063\u3066\u3082\u5b89\u5fc3)
$ sudo visudo\r\n$ sudo git diff /etc/sudoers\r\ndiff --git a/sudoers b/sudoers\r\nindex d4cc632..ac3bd77 100644\r\n--- a/sudoers\r\n+++ b/sudoers\r\n@@ -21,6 +21,7 @@ root ALL=(ALL:ALL) ALL\r\n\r\n # Allow members of group sudo to execute any command\r\n %sudo ALL=(ALL:ALL) ALL\r\n+%adm ALL=NOPASSWD: /usr/bin/dmesg\r\n\r\n # See sudoers(5) for more information on "#include" directives:\r\n\r\n\nadm group \u306e\u30e6\u30fc\u30b6\u3067dmesg \u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d
\n$ sudo -l | grep dmesg\r\n (root) NOPASSWD: /usr/bin/dmesg\r\n\nadm group \u306e\u30e6\u30fc\u30b6\u304c\u8a8d\u8a3c\u7121\u3057\u3067 sudo dmesg \u304c\u5b9f\u884c\u3067\u304d\u308b\u306e\u3092\u78ba\u8a8d
$ id | grep -o adm\r\nadm\r\n$ sudo dmesg -H | tail -1\r\n[ +0.015080] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n\n\u3053\u306e\u3068\u304d kernel.dmesg_restrict = 1 \u3067 sudo \u3092\u901a\u3055\u306a\u3044\u3068 dmesg \u306f\u5b9f\u884c\u3067\u304d\u306a\u3044
$ cat /proc/sys/kernel/dmesg_restrict\r\n1\r\n$ dmesg \r\ndmesg: read kernel buffer failed: Operation not permitted\r\n$ LC_MESSAGES=ja_JP.UTF-8 dmesg \r\ndmesg: read kernel buffer failed: \u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c\u3067\u3059\r\n\n~/.profile \u306balias \u3092\u8a2d\u5b9a
$ echo 'alias dmesg="sudo dmesg"' | tee -a ~/.profile \r\nalias dmesg="sudo dmesg"\r\n$ source ~/.profile\r\n$ dmesg -H | tail -1\r\n[ +0.015080] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n\n\u74b0\u5883
\n$ dpkg-query -W sudo util-linux linux-image-*\r\nlinux-image-4.19.0-2-arm64 4.19.16-1\r\nlinux-image-4.19.0-2-arm64-unsigned\r\nlinux-image-arm64 4.19+102\r\nsudo 1.8.27-1\r\nutil-linux 2.33.1-0.1\r\n$ lsb_release -dr\r\nDescription: Debian GNU/Linux buster/sid\r\nRelease: testing\r\n$ uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n$ cat /proc/device-tree/model ;echo\r\nRaspberry Pi 3 Model B Rev 1.2\r\n\n\n",
"content_text": "Debian \u306e linux 4.8.0 \u4ee5\u964d\u3067\u4e00\u822c\u30e6\u30fc\u30b6\u306b\u3088\u308b dmesg \u304c\u7121\u52b9\u5316\u3055\u308c\u305f\u306e\u3067\uff0ckernel\u30d1\u30e9\u30e1\u30fc\u30bf\u306e kernel.dmesg_restrict \u3092\u4fee\u6b63\u3057\u3066 dmesg command \u3092\u4e00\u822c\u30e6\u30fc\u30b6\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u304c\u3053\u308c\u3060\u3068\u5168\u30e6\u30fc\u30b6\u3067\u5b9f\u884c\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\uff0esudo \u3092\u8a2d\u5b9a\u3057\u3066\u30ed\u30b0\u306e\u8aad\u3081\u308b adm \u30e6\u30fc\u30b6\u3060\u3051\u304c dmesg command \u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\uff0e\n\nDebian buster/sid \u3067dmesg\u3092\u4e00\u822c\u30e6\u30fc\u30b6\u3067\u5b9f\u884c \u2013 matoken’s meme\n\ndmesg\u3092\u5b9f\u884c\u3057\u305f\u3044\u30e6\u30fc\u30b6\u3092adm group \u306b\u767b\u9332\u3059\u308b(login\u3057\u76f4\u3057\u3066\u53cd\u6620\u3057\u3066\u304a\u304f)\n$ sudo addgroup matoken adm\r\n$ exit\r\n\nvisudo command \u3067 /etc/sudoers \u3092\u7de8\u96c6\u3057\u3066 adm group \u306f NOPASSWD \u3067 dmesg command \u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b(\u5ff5\u306e\u70ba\u7de8\u96c6\u524d\u306b\u3082\u30461\u679a\u7aef\u672b\u3092\u958b\u3044\u3066 sudo -s \u3057\u3066\u304a\u3044\u305f\u308a\uff0cat\u7b49\u30675\u5206\u5f8c\u306b /etc/sudoers \u3092\u5dfb\u304d\u623b\u3059\u3088\u3046\u306b\u3057\u3066\u304a\u304f\u3068\u30df\u30b9\u3063\u3066\u3082\u5b89\u5fc3)\n$ sudo visudo\r\n$ sudo git diff /etc/sudoers\r\ndiff --git a/sudoers b/sudoers\r\nindex d4cc632..ac3bd77 100644\r\n--- a/sudoers\r\n+++ b/sudoers\r\n@@ -21,6 +21,7 @@ root ALL=(ALL:ALL) ALL\r\n\r\n # Allow members of group sudo to execute any command\r\n %sudo ALL=(ALL:ALL) ALL\r\n+%adm ALL=NOPASSWD: /usr/bin/dmesg\r\n\r\n # See sudoers(5) for more information on "#include" directives:\r\n\r\n\nadm group \u306e\u30e6\u30fc\u30b6\u3067dmesg \u30b3\u30de\u30f3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u78ba\u8a8d\n$ sudo -l | grep dmesg\r\n (root) NOPASSWD: /usr/bin/dmesg\r\n\nadm group \u306e\u30e6\u30fc\u30b6\u304c\u8a8d\u8a3c\u7121\u3057\u3067 sudo dmesg \u304c\u5b9f\u884c\u3067\u304d\u308b\u306e\u3092\u78ba\u8a8d\n$ id | grep -o adm\r\nadm\r\n$ sudo dmesg -H | tail -1\r\n[ +0.015080] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n\n\u3053\u306e\u3068\u304d kernel.dmesg_restrict = 1 \u3067 sudo \u3092\u901a\u3055\u306a\u3044\u3068 dmesg \u306f\u5b9f\u884c\u3067\u304d\u306a\u3044\n$ cat /proc/sys/kernel/dmesg_restrict\r\n1\r\n$ dmesg \r\ndmesg: read kernel buffer failed: Operation not permitted\r\n$ LC_MESSAGES=ja_JP.UTF-8 dmesg \r\ndmesg: read kernel buffer failed: \u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c\u3067\u3059\r\n\n~/.profile \u306balias \u3092\u8a2d\u5b9a\n$ echo 'alias dmesg="sudo dmesg"' | tee -a ~/.profile \r\nalias dmesg="sudo dmesg"\r\n$ source ~/.profile\r\n$ dmesg -H | tail -1\r\n[ +0.015080] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n\n\u74b0\u5883\n$ dpkg-query -W sudo util-linux linux-image-*\r\nlinux-image-4.19.0-2-arm64 4.19.16-1\r\nlinux-image-4.19.0-2-arm64-unsigned\r\nlinux-image-arm64 4.19+102\r\nsudo 1.8.27-1\r\nutil-linux 2.33.1-0.1\r\n$ lsb_release -dr\r\nDescription: Debian GNU/Linux buster/sid\r\nRelease: testing\r\n$ uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n$ cat /proc/device-tree/model ;echo\r\nRaspberry Pi 3 Model B Rev 1.2",
"date_published": "2019-03-03T22:43:09+09:00",
"date_modified": "2019-03-03T22:53:19+09:00",
"authors": [
{
"name": "matoken",
"url": "https://matoken.org/blog/author/matoken/",
"avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g"
}
],
"author": {
"name": "matoken",
"url": "https://matoken.org/blog/author/matoken/",
"avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g"
},
"tags": [
"Debian",
"Debian buster",
"Raspberry Pi 3 B",
"RaspberryPi",
"buster",
"Linux"
]
},
{
"id": "http://matoken.org/blog/?p=2302",
"url": "https://matoken.org/blog/2019/03/03/run-dmesg-as-a-general-user-with-debian-buster-sid/",
"title": "Debian buster/sid \u3067dmesg\u3092\u4e00\u822c\u30e6\u30fc\u30b6\u3067\u5b9f\u884c",
"content_html": "\u203b\u3053\u306e\u65b9\u6cd5\u3060\u3068\u5168\u30e6\u30fc\u30b6\u3067 dmesg \u304c\u5b9f\u884c\u3067\u304d\u3066\u3057\u307e\u3046\u306e\u3067 sudo \u3092\u4f7f\u3063\u3066\u30b0\u30eb\u30fc\u30d7\u3092\u5236\u9650\u3059\u308b\u6b21\u306e\u65b9\u6cd5\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044\uff0e
Debian buster arm64 \u74b0\u5883\u3092\u4f5c\u308a\u307e\u3057\u305f( Raspberry Pi 3 Model B \u306e USB\u8d77\u52d5\u3067 Debian buster arm64 \u3092\u52d5\u304b\u3059 \u2013 matoken’s meme )\u304c\uff0cdmesg \u3067\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\uff0esudo dmesg \u306f\u52d5\u304f\uff0e
$ dmesg \r\ndmesg: read kernel buffer failed: Operation not permitted\r\n$ LC_MESSAGES=ja_JP.UTF-8 dmesg \r\ndmesg: read kernel buffer failed: \u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c\u3067\u3059\r\n\n\u305d\u3046\u3044\u3048\u3070\u4ee5\u524d Debian sid amd64 \u3067\u3082\u8d77\u3053\u3063\u305f\u73fe\u8c61\u3067\u3059\uff0e
\nDebian \u3067\u306f Linux 4.8.0 \u304b\u3089\u4ed5\u69d8\u304c\u5909\u308f\u3063\u3066root \u4ee5\u5916\u3067\u306fdmesg \u304c\u8aad\u3081\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0elog file \u306e\u8aad\u3081\u308b adm group \u306e\u30e6\u30fc\u30b6\u3082\u99c4\u76ee\uff0e
\n\u3053\u308c\u306f kernel\u30d1\u30e9\u30e1\u30fc\u30bf\u306e kernel.dmesg_restrict \u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e
$ sudo sysctl -a|grep dmesg\r\nkernel.dmesg_restrict = 1\r\n$ cat /proc/sys/kernel/dmesg_restrict\r\n1\r\n\n\u3053\u308c\u3092 1 \u304b\u3089 0 \u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u4ee5\u524d\u3068\u540c\u3058\u52d5\u4f5c\u3068\u306a\u308a\u307e\u3059\uff0esysctl \u30b3\u30de\u30f3\u30c9\u3084\uff0c
$ sudo sysctl -w kernel.dmesg_restrict=0\r\n\n/proc/sys/kernel/dmesg_restrict \u3092\u76f4\u63a5\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u4e00\u6642\u7684\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\uff0e
echo 0 | sudo tee /proc/sys/kernel/dmesg_restrict\r\n\n\u52d5\u304d\u307e\u3057\u305f\uff0e
\n$ id | grep -o adm\r\n$ echo hello | sudo tee /dev/kmsg \r\nhello\r\n[ 562.152729] hello\r\n$ dmesg -H | tail\r\n[ +0.019933] brcmfmac mmc1:0001:1: firmware: failed to load brcm/brcmfmac43430-sdio.clm_blob (-2)\r\n[ +0.020182] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware\r\n[ +0.020886] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.clm_blob failed with error -2\r\n[ +0.021916] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available\r\n[ +0.026818] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f\r\n[ +0.077925] systemd-udevd[376]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.\r\n[ +0.537137] EXT4-fs (sda2): re-mounted. Opts: (null)\r\n[ +2.001639] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup\r\n[ +1.563625] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n[Mar 2 05:58] hello\r\n\n\u518d\u8d77\u52d5\u3059\u308b\u3068\u5143\u306b\u623b\u3063\u3066\u3057\u307e\u3046\u306e\u3067\uff0c/etc/sysctl.d/local.conf \u306a\u3069\u306b\u8a2d\u5b9a\u3092\u66f8\u3044\u3066\u304f\u3068\u6b21\u56de\u8d77\u52d5\u6642\u4ee5\u964d\u3082\u53cd\u6620\u3055\u308c\u307e\u3059\uff0e
$ sudo install -m 644 -o root -g root /dev/null /etc/sysctl.d/local.conf\r\n$ echo 'kernel.dmesg_restrict = 0' | sudo tee -a /etc/sysctl.d/local.conf\r\nkernel.dmesg_restrict = 0\r\n\n\u8a66\u3057\u305f\u74b0\u5883
\n$ dmesg --version\r\ndmesg from util-linux 2.33.1\r\n$ dpkg-query -W util-linux linux-image-*\r\nlinux-image-4.19.0-2-arm64 4.19.16-1\r\nlinux-image-4.19.0-2-arm64-unsigned\r\nlinux-image-arm64 4.19+102\r\nutil-linux 2.33.1-0.1\r\n$ lsb_release -dr\r\nDescription: Debian GNU/Linux buster/sid\r\nRelease: testing\r\n$ uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n$ cat /proc/device-tree/model ;echo\r\nRaspberry Pi 3 Model B Rev 1.2\r\n\n\n\n",
"content_text": "\u203b\u3053\u306e\u65b9\u6cd5\u3060\u3068\u5168\u30e6\u30fc\u30b6\u3067 dmesg \u304c\u5b9f\u884c\u3067\u304d\u3066\u3057\u307e\u3046\u306e\u3067 sudo \u3092\u4f7f\u3063\u3066\u30b0\u30eb\u30fc\u30d7\u3092\u5236\u9650\u3059\u308b\u6b21\u306e\u65b9\u6cd5\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044\uff0e\n\n\u7279\u5b9a\u30b0\u30eb\u30fc\u30d7\u3067\u306e\u307f dmesg command \u3092\u6709\u52b9\u306b\u3059\u308b \u2013 matoken’s meme\n\n\nDebian buster arm64 \u74b0\u5883\u3092\u4f5c\u308a\u307e\u3057\u305f( Raspberry Pi 3 Model B \u306e USB\u8d77\u52d5\u3067 Debian buster arm64 \u3092\u52d5\u304b\u3059 \u2013 matoken’s meme )\u304c\uff0cdmesg \u3067\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\uff0esudo dmesg \u306f\u52d5\u304f\uff0e\n$ dmesg \r\ndmesg: read kernel buffer failed: Operation not permitted\r\n$ LC_MESSAGES=ja_JP.UTF-8 dmesg \r\ndmesg: read kernel buffer failed: \u8a31\u53ef\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c\u3067\u3059\r\n\n\u305d\u3046\u3044\u3048\u3070\u4ee5\u524d Debian sid amd64 \u3067\u3082\u8d77\u3053\u3063\u305f\u73fe\u8c61\u3067\u3059\uff0e\nDebian \u3067\u306f Linux 4.8.0 \u304b\u3089\u4ed5\u69d8\u304c\u5909\u308f\u3063\u3066root \u4ee5\u5916\u3067\u306fdmesg \u304c\u8aad\u3081\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff0elog file \u306e\u8aad\u3081\u308b adm group \u306e\u30e6\u30fc\u30b6\u3082\u99c4\u76ee\uff0e\n\u3053\u308c\u306f kernel\u30d1\u30e9\u30e1\u30fc\u30bf\u306e kernel.dmesg_restrict \u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e\n$ sudo sysctl -a|grep dmesg\r\nkernel.dmesg_restrict = 1\r\n$ cat /proc/sys/kernel/dmesg_restrict\r\n1\r\n\n\u3053\u308c\u3092 1 \u304b\u3089 0 \u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u4ee5\u524d\u3068\u540c\u3058\u52d5\u4f5c\u3068\u306a\u308a\u307e\u3059\uff0esysctl \u30b3\u30de\u30f3\u30c9\u3084\uff0c\n$ sudo sysctl -w kernel.dmesg_restrict=0\r\n\n/proc/sys/kernel/dmesg_restrict \u3092\u76f4\u63a5\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u4e00\u6642\u7684\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\uff0e\necho 0 | sudo tee /proc/sys/kernel/dmesg_restrict\r\n\n\u52d5\u304d\u307e\u3057\u305f\uff0e\n$ id | grep -o adm\r\n$ echo hello | sudo tee /dev/kmsg \r\nhello\r\n[ 562.152729] hello\r\n$ dmesg -H | tail\r\n[ +0.019933] brcmfmac mmc1:0001:1: firmware: failed to load brcm/brcmfmac43430-sdio.clm_blob (-2)\r\n[ +0.020182] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware\r\n[ +0.020886] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.clm_blob failed with error -2\r\n[ +0.021916] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available\r\n[ +0.026818] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f\r\n[ +0.077925] systemd-udevd[376]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.\r\n[ +0.537137] EXT4-fs (sda2): re-mounted. Opts: (null)\r\n[ +2.001639] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup\r\n[ +1.563625] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1\r\n[Mar 2 05:58] hello\r\n\n\u518d\u8d77\u52d5\u3059\u308b\u3068\u5143\u306b\u623b\u3063\u3066\u3057\u307e\u3046\u306e\u3067\uff0c/etc/sysctl.d/local.conf \u306a\u3069\u306b\u8a2d\u5b9a\u3092\u66f8\u3044\u3066\u304f\u3068\u6b21\u56de\u8d77\u52d5\u6642\u4ee5\u964d\u3082\u53cd\u6620\u3055\u308c\u307e\u3059\uff0e\n$ sudo install -m 644 -o root -g root /dev/null /etc/sysctl.d/local.conf\r\n$ echo 'kernel.dmesg_restrict = 0' | sudo tee -a /etc/sysctl.d/local.conf\r\nkernel.dmesg_restrict = 0\r\n\n\u8a66\u3057\u305f\u74b0\u5883\n$ dmesg --version\r\ndmesg from util-linux 2.33.1\r\n$ dpkg-query -W util-linux linux-image-*\r\nlinux-image-4.19.0-2-arm64 4.19.16-1\r\nlinux-image-4.19.0-2-arm64-unsigned\r\nlinux-image-arm64 4.19+102\r\nutil-linux 2.33.1-0.1\r\n$ lsb_release -dr\r\nDescription: Debian GNU/Linux buster/sid\r\nRelease: testing\r\n$ uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n$ cat /proc/device-tree/model ;echo\r\nRaspberry Pi 3 Model B Rev 1.2\r\n\n\ndmesg – Debian Wiki",
"date_published": "2019-03-03T22:07:56+09:00",
"date_modified": "2019-03-03T22:57:19+09:00",
"authors": [
{
"name": "matoken",
"url": "https://matoken.org/blog/author/matoken/",
"avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g"
}
],
"author": {
"name": "matoken",
"url": "https://matoken.org/blog/author/matoken/",
"avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g"
},
"tags": [
"Debian",
"Debian buster",
"Raspberry Pi 3 B",
"RaspberryPi",
"buster",
"Linux"
]
},
{
"id": "http://matoken.org/blog/?p=2295",
"url": "https://matoken.org/blog/2019/03/01/launch-debian-buster-arm-64-with-raspberry-pi-3-model-b-usb-boot/",
"title": "Raspberry Pi 3 Model B \u306e USB\u8d77\u52d5\u3067 Debian buster arm64 \u3092\u52d5\u304b\u3059",
"content_html": "\u6700\u8fd1\u5165\u624b\u3057\u305f(\u9045) RaspberryPi 3 model B \u3067 USB \u30e1\u30e2\u30ea\u8d77\u52d5\u306e Debian buster aarch64 \u3092\u8a2d\u5b9a\u3057\u3066\u307f\u305f\u3068\u304d\u306e\u30e1\u30e2\u3067\u3059\uff0e
\n\u30b8\u30e2\u30c6\u30a3\u30fc\u7d4c\u7531\u3067 Raspberry Pi 3 model B \u3092\u5165\u624b\u3057\u307e\u3057\u305f\uff0eRaspberry Pi 3 model B + USB Wi-Fi + USB Bluetooth + \u30b1\u30fc\u30b9\u306e\u30bb\u30c3\u30c8\u304c2,500\u5186 + \u9001\u6599\u624b\u6570\u6599 500\u5186\u3068\u5b89\u3044\u3067\u3059\uff0e\u666e\u901a\u306b\u65b0\u54c1\u3067\u8cb7\u3046\u3068 8,000\u5186\u8fd1\u304f\u3059\u308b\u3068\u601d\u3044\u307e\u3059\uff0e\u4eca\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u6642\u70b9\u3067\u672a\u3060\u5728\u5eab\u306f\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u8208\u5473\u306e\u3042\u308b\u4eba\u306f\u8cb7\u3046\u3068\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e(6\u500b\u540c\u68b1\u53ef\u80fd\u306a\u306e\u3067\u305d\u308c\u3060\u30681\u500b\u3042\u305f\u308a\u304c\u5c11\u3057\u5b89\u304f\u306a\u308b\u306e\u3067\u8fd1\u6240\u306e\u53cb\u9054\u3068\u8cb7\u3046\u3068\u3044\u3044\u304b\u3082)
\n\n\n64bit\u306b\u306a\u3063\u305f Raspberry Pi \u306f\u6b32\u3057\u3044\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u5b89\u304f\u624b\u306b\u5165\u3063\u3066\u52a9\u304b\u308a\u307e\u3057\u305f :)
\n(\u5f8c\u7d99\u306e Raspberry Pi 3 Model B+/A+ \u3084\uff0cSoC\u304c 3B \u3068\u540c\u3058\u3067\u7121\u7dda\u6a5f\u80fd\u306e\u306a\u3044 2B v1.2 \u3068\u304b\u3082\u6b32\u3057\u3044\u3067\u3059\u306d\uff0e)
Raspberry Pi 3 model B \u306f 32bit\u3060\u3051\u3067\u306a\u304f64bit \u3082\u5229\u7528\u3067\u304d\u308b\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u3059\uff0e\u305b\u3063\u304b\u304f\u306a\u306e\u3067 64bit\u3067\u52d5\u304b\u3057\u305f\u3044\u3051\u3069\u4eca\u306e\u6642\u70b9\u3067\u306f Raspbian \u306f 32bit\u306e\u307f\u3067\u3059\uff0e\u305d\u3053\u3067 Debian \u306e arm64 \u3092\u8a66\u3059\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0e
\n\u30a4\u30e1\u30fc\u30b8\u306f\u5ca9\u677e\u3055\u3093\u306e\u6771\u4eac\u30a8\u30ea\u30a2Debian\u52c9\u5f37\u4f1a\u306e\u8cc7\u6599\u3092\u771f\u4f3c\u3057\u3066\u4f5c\u308d\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\uff0c
\n\nDebianWiki \u306e RaspberryPi3 \u306e\u9805\u76ee\u3092\u898b\u305f\u3089\u975e\u516c\u5f0f\u3060\u3051\u3069\u30a4\u30e1\u30fc\u30b8\u304c\u3042\u3063\u305f\u306e\u3067\u4eca\u56de\u306f\u305d\u308c\u3092\u5229\u7528\u3057\u307e\u3057\u305f\uff0e\u73fe\u5728 testing \u306e Buster \u306e\u30a4\u30e1\u30fc\u30b8\u304c\u5165\u624b\u3067\u304d\u307e\u3059\uff0e
\n\u30b9\u30c8\u30ec\u30fc\u30b8\u306f\u901a\u5e38 microSD \u3092\u5229\u7528\u3057\u307e\u3059\u304c\uff0c\u624b\u6301\u3061\u304c\u306a\u3044\u306e\u3068 Raspberry Pi 3 B \u306fUSB\u8d77\u52d5\u304c\u53ef\u80fd\u306a\u306f\u305a\u306a\u306e\u3067USB\u30e1\u30e2\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0eUSB 2.0\u63a5\u7d9a\u306e\u5bb9\u91cf2GB\u306e\u3082\u306e\u3092\u7528\u610f\u3057\u307e\u3057\u305f\uff0e
\n\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u30a4\u30e1\u30fc\u30b8\u3092\u5165\u624b\u3057\u3066\u30cf\u30c3\u30b7\u30e5\u306e\u30c1\u30a7\u30c3\u30af\u3092\u3057\u305f\u5f8cUSB\u30e1\u30e2\u30ea\u3078\u66f8\u304d\u8fbc\u307f\u307e\u3057\u305f\uff0e\u3053\u3053\u3067\u306f Linux\u306edd\u30b3\u30de\u30f3\u30c9\u3067\u66f8\u304d\u8fbc\u3093\u3067\u3044\u307e\u3059\u304c\uff0cEtcher\u306a\u3069\u3092\u5229\u7528\u3059\u308b\u3068\u8272\u3005\u306a\u74b0\u5883\u3067GUI\u3067\u306e\u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u3067\u3059\uff0e
\n\u203b\u30a4\u30e1\u30fc\u30b8\u306f\u6700\u65b0\u306e\u3082\u306e\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff0e
$ wget -c https://people.debian.org/~gwolf/raspberrypi3/20190206/20190206-raspberry-pi-3-buster-PREVIEW.img.xz https://people.debian.org/~gwolf/raspberrypi3/20190206/20190206-raspberry-pi-3-buster-PREVIEW.img.xz.sha256\r\n$ sha256sum -c ./20190206-raspberry-pi-3-buster-PREVIEW.img.xz.sha256\r\n20190206-raspberry-pi-3-buster-PREVIEW.img.xz: \u5b8c\u4e86\r\n$ xzcat 20190206-raspberry-pi-3-buster-PREVIEW.img.xz | pv | sudo dd of=/dev/sdb bs=1M oflag=dsync\r\n\n\u6ce8\u610f:OTP\u306e\u8a2d\u5b9a\u306f1\u5ea6\u3057\u304b\u51fa\u6765\u306a\u3044\u3057\uff0c\u5143\u306b\u623b\u3059\u3053\u3068\u3082\u51fa\u6765\u306a\u3044\u3068\u601d\u308f\u308c\u307e\u3059\uff0e\u8d77\u52d5\u6642\u9593\u304c\u9577\u304f\u306a\u308b\u306a\u3069\u30c7\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308b\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff0e
\n\u3053\u306eUSB\u30e1\u30e2\u30ea\u3092 Raspberry Pi \u306b\u63a5\u7d9a\u3057\u3066\u96fb\u6e90\u3092\u5165\u308c\u3066\u307f\u307e\u3057\u305f\u304c\u8d77\u52d5\u3057\u307e\u305b\u3093\uff0e\u6050\u3089\u304f OTP(One Time Programmable)\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a\u304c USB\u8d77\u52d5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u307e\u3059\uff0e(Raspberry Pi 3+ \u30b7\u30ea\u30fc\u30ba\u306f\u6a19\u6e96\u3067USB\u8d77\u52d5\u53ef\u80fd\u306a\u306e\u3067\u3053\u306e\u8a2d\u5b9a\u306f\u4e0d\u8981\u306a\u306f\u305a\u3067\u3059\uff0e)
\n\n\u5148\u305a Raspbian 2017-04-10 \u4ee5\u964d\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u66f8\u304d\u8fbc\u3093\u3060 microSD \u3092\u7528\u610f\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\uff0e
\n( uart\u7d4c\u7531\u3067\u7e4b\u304e\u305f\u3044\u5834\u5408\u8d77\u52d5\u524d\u306b /boot/config.txt \u306b enable_uart=1 \u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\uff0e $ echo enable_uart=1 | tee -a /media/matoken/boot/config.txt )
OTP \u3092\u78ba\u8a8d\u3059\u308b\u3068\u3084\u306f\u308a\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\uff0e
\npi@raspberrypi:~$ vcgencmd otp_dump | grep ^17:\r\n17:1020000a\r\n\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b /boot/config.txt \u306b program_usb_boot_mode=1 \u3092\u8ffd\u8a18\u3057\u3066\u518d\u8d77\u52d5\u3059\u308b\u3068\u53cd\u6620\u3055\u308c\u307e\u3059\uff0e
$ echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt\r\nprogram_usb_boot_mode=1\r\npi@raspberrypi:~$ sudo reboot\r\n\n17 \u304c 3020000a \u306b\u5909\u308f\u308c\u3070OK
\npi@raspberrypi:~$ vcgencmd otp_dump | grep ^17:\r\n17:3020000a\r\n\n\u8a73\u7d30\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044
\n\n17 \u2013 bootmode register\r\n\r\nBit 1: sets the oscillator frequency to 19.2MHz\r\nBit 3: enables pull ups on the SDIO pins\r\nBit 19: enables GPIO bootmode\r\nBit 20: sets the bank to check for GPIO bootmode\r\nBit 21: enables booting from SD card\r\nBit 22: sets the bank to boot from\r\nBit 28: enables USB device booting\r\nBit 29: enables USB host booting (ethernet and mass storage)\r\n\n\u8a2d\u5b9a\u524d\u304c\uff0c1020000a -> 0b010000001000000000000000001010 \u3067\u8a2d\u5b9a\u5f8c\u304c\uff0c0x3020000a -> 0b110000001000000000000000001010 \u3066\u3053\u3068\u3067\uff0cBit 29 \u304c 0 \u304b\u3089 1 \u306b\u306a\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d77\u52d5\u3068USB\u8d77\u52d5\u3092\u8a66\u3059\u3088\u3046\u306b\u308a\u307e\u3059\uff0e\u3053\u306e\u72b6\u614b\u3067 microSD \u8d77\u52d5\u3092\u8a66\u3059\u3068\u3053\u308c\u3082\u5927\u4e08\u592b\u3067\u3057\u305f\uff0e(\u512a\u5148\u5ea6\u306f microSD > USB\uff0cNetwork\u306f\u672a\u78ba\u8a8d)
\u3053\u306e\u72b6\u614b\u3067 shutdown \u3057\uff0cmicroSD \u3092\u53d6\u308a\u51fa\u3057\u3066 Debian \u306e\u5c0e\u5165\u3057\u305f USB \u30e1\u30e2\u30ea\u3092\u63a5\u7d9a\u3057\u3066\u8d77\u52d5\u3067\u8d77\u52d5\u3057\u307e\u3057\u305f\uff0e(USB\u8d77\u52d5\u306e\u5834\u5408\u306a\u304b\u306a\u304b\u8d77\u52d5\u304c\u59cb\u307e\u3089\u305a\u7126\u3063\u305f\u3051\u306930\u79d2\u307b\u3069\u5f85\u3064\u3068UART\u306b\u30ed\u30b0\u304c\u51fa\u306f\u3058\u3081\u308b\uff0eHDMI\u306e\u51fa\u529b\u306f\u672a\u78ba\u8a8d)
\nlogin \u306f root:raspberry
\n\u3061\u3083\u3093\u3068 64bit \u3067\u3059 :)
root@rpi3:~# uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u66f4\u65b0
\nroot@rpi3:~# apt update && apt upgrade\r\n\n\u4e00\u822c\u30e6\u30fc\u30b6\u306e\u8ffd\u52a0
\nroot@rpi3:~# useradd -m matoken\r\nroot@rpi3:~# passwd matoken\r\nEnter new UNIX password: \r\nRetype new UNIX password: \r\npasswd: password updated successfully\r\nroot@rpi3:~# chsh matoken -s /bin/bash\r\n\nOpenSSH \u306e\u8a2d\u5b9a\u5909\u66f4
\nroot@rpi3:~# diff -u /etc/ssh/sshd_config.old /etc/ssh/sshd_config\r\n--- /etc/ssh/sshd_config.old 2019-02-06 15:15:46.940904823 +0000\r\n+++ /etc/ssh/sshd_config 2019-02-16 13:17:17.076873278 +0000\r\n@@ -29,7 +29,7 @@\r\n # Authentication:\r\n\r\n #LoginGraceTime 2m\r\n-PermitRootLogin yes\r\n+PermitRootLogin prohibit-password\r\n #StrictModes yes\r\n #MaxAuthTries 6\r\n #MaxSessions 10\r\n@@ -53,7 +53,7 @@\r\n #IgnoreRhosts yes\r\n\r\n # To disable tunneled clear text passwords, change to no here!\r\n-#PasswordAuthentication yes\r\n+PasswordAuthentication no\r\n #PermitEmptyPasswords no\r\n\r\n # Change to yes to enable challenge-response passwords (beware issues with\r\n@@ -119,3 +119,5 @@\r\n # AllowTcpForwarding no\r\n # PermitTTY no\r\n # ForceCommand cvs server\r\n+\r\n+AllowGroups sshusers\r\n\nsshusers \u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u3066 ssh login \u51fa\u6765\u308b\u30e6\u30fc\u30b6\u3092\u767b\u9332
root@rpi3:~# sudo groupadd sshusers\r\nroot@rpi3:~# sudo usermod -a -G sshusers matoken\r\n\n\u77ed\u3044modulus \u3092\u524a\u9664\u3059\u308b
\nroot@rpi3:~# awk '$5>=3071' /etc/ssh/moduli | tee /etc/ssh/moduli.tmp\r\nroot@rpi3:~# wc -l /etc/ssh/moduli /etc/ssh/moduli.tmp\r\n 427 /etc/ssh/moduli\r\n 368 /etc/ssh/moduli.tmp\r\n 795 total\r\nroot@rpi3:~# sudo mv /etc/ssh/moduli.tmp /etc/ssh/moduli\r\n\nhostpc\u304b\u3089ssh\u516c\u958b\u9375\u3092cp\u3057\u3066\u304a\u304f
\n$ ssh-copy-id -i ~/.ssh/id_ed25519_pi.pub matoken@rpi3\r\n\nssh\u9375\u30da\u30a2\u3092\u4f5c\u3063\u3066\u304a\u304f
\nroot@rpi3:~# sudo -u matoken ssh-keygen -t ed25519\r\n\nsshd \u306e\u518d\u8d77\u52d5
\nroot@rpi3:~# systemctl restart ssh\r\n\nssh login\u6642\u306b\u901a\u77e5\u3092\u98db\u3070\u3059\u3088\u3046\u306b\u3057\u3066\u304a\u304f
\nroot@rpi3:~# vi /etc/ssh/sshrc\r\nroot@rpi3:~# chmod +x /etc/ssh/sshrc\r\nroot@rpi3:~# cat /etc/ssh/sshrc\r\n#!/bin/sh\r\n\r\n/home/matoken/bin/telegram.sh sshrc:${USER}@`hostname`:${SSH_CONNECTION}\r\n/home/matoken/bin/sms.sh sshrc:${USER}@`hostname`:${SSH_CONNECTION}\r\n\nssh \u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u305a\uff0c\u9375\u8a8d\u8a3c\u3067\u30ed\u30b0\u30a4\u30f3\u304c\u51fa\u6765\u308b&\u901a\u77e5\u304c\u98db\u3076\u306e\u3092\u78ba\u8a8d
\nroot@rpi3:~# ssh root@localhost -o PasswordAuthentication=yes\r\nroot@rpi3:~# ssh matoken@localhost -o PasswordAuthentication=yes\r\nroot@rpi3:~# ssh matoken@localhost -i ~/.ssh/id_ed25519\r\n\n\u81ea\u5206\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066 /etc/iptables/rules.v4, /etc/iptables/rules.v6 \u3092\u5909\u66f4\uff0e
root@rpi3:~# grep -v ^# /etc/iptables/rules.v4\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -s 127.0.0.0/8 -m comment --comment "RFC3330 loopback" -j ACCEPT\r\n-A INPUT -s 192.168.1.0/24 -m comment --comment "RFC1918 reserved" -j ACCEPT\r\n-A INPUT -p tcp -m tcp --dport 22 -m comment --comment SSH -j REJECT --reject-with icmp-port-unreachable\r\nCOMMIT\r\nroot@rpi3:~# grep -v ^# /etc/iptables/rules.v6\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -s ::1/128 -m comment --comment "RFC3513 loopback" -j ACCEPT\r\n-A INPUT -p tcp -m tcp --dport 22 -m comment --comment SSH -j REJECT --reject-with icmp6-port-unreachable\r\nCOMMIT\r\n\nsudo \u3092\u5c0e\u5165\u3057\u3066\u8a2d\u5b9a
\nroot@rpi3:~# apt install sudo\r\n\nsudo group\u306b\u30e6\u30fc\u30b6\u3092\u767b\u9332
\nroot@rpi3:~# usermod -a -G sudo matoken\r\n\nsudo \u304c\u5229\u7528\u3067\u304d\u308b\u306e\u3092\u78ba\u8a8d
\nmatoken@rpi3:~$ sudo grep ^root: /etc/shadow\r\nsudo: unable to resolve host rpi3: Name or service not known\r\nroot:!..VyaTFxP8kT6:17933:0:99999:7:::\r\n\nroot\u30e6\u30fc\u30b6\u3092\u30ed\u30c3\u30af
\n$ sudo passwd -l root \r\nsudo: unable to resolve host rpi3: Name or service not known\r\npasswd: password expiry information changed.\r\nmatoken@rpi3:~$ sudo passwd -S root\r\nsudo: unable to resolve host rpi3: Name or service not known\r\nroot L 02/06/2019 0 99999 7 -1\r\n\nsudo\u6642\u306a\u3069\u306b\u300csudo: unable to resolve host rpi3: Name or service not known\u300d\u3068\u8a00\u308f\u308c\u308b\u306e\u3067 hosts \u306e localhost \u306b rpi3 \u3092\u8ffd\u52a0
matoken@rpi3:~$ sudo vi /etc/hosts\r\n127.0.0.1 localhost rpi3\r\n\n\u3053\u3053\u3067\u518d\u8d77\u52d5\u3059\u308b\u3068 rootfs \u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u8a00\u308f\u308c\u8d77\u52d5\u3057\u306a\u3044\uff0e
\n(initramfs) Gave up waiting for root file system device. Common problems:\r\n- Boot args (cat /proc/cmdline)\r\n- Check rootdelay= (did the system wait long enough?)\r\n- Missing modules (cat /proc/modules; ls /dev)\r\nALERT! /dev/mmcblk0p2 does not exist. Dropping to a shell!\r\n\r\n\r\nBusyBox v1.27.2 (Debian 1:1.27.2-3) built-in shell (ash)\r\nEnter 'help' for a list of built-in commands.\r\n\ncmdline \u3067\u306f /dev/mmcblkp2 \u304b\u3089\u8d77\u52d5\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u304c\uff0c /dev/sda2 \u304b\u3089\u8d77\u52d5\u3057\u305f\u3044
\n(initramfs) ls /dev\r\nblock tty12 tty47\r\nbsg tty13 tty48\r\nbus tty14 tty49\r\nchar tty15 tty5\r\nconsole tty16 tty50\r\ncore tty17 tty51\r\ncpu_dma_latency tty18 tty52\r\ndisk tty19 tty53\r\nfb0 tty2 tty54\r\nfd tty20 tty55\r\nfull tty21 tty56\r\ngpiochip0 tty22 tty57\r\ngpiochip1 tty23 tty58\r\ninput tty24 tty59\r\nkmsg tty25 tty6\r\nkvm tty26 tty60\r\nmem tty27 tty61\r\nmemory_bandwidth tty28 tty62\r\nnetwork_latency tty29 tty63\r\nnetwork_throughput tty3 tty7\r\nnull tty30 tty8\r\nport tty31 tty9\r\npsaux tty32 ttyAMA0\r\nptmx tty33 ttyS0\r\npts tty34 ttyS1\r\nrandom tty35 ttyS2\r\nsda tty36 ttyS3\r\nsda1 tty37 urandom\r\nsda2 tty38 vcs\r\nsnapshot tty39 vcs1\r\nstderr tty4 vcsa\r\nstdin tty40 vcsa1\r\nstdout tty41 vcsu\r\ntty tty42 vcsu1\r\ntty0 tty43 vga_arbiter\r\ntty1 tty44 zero\r\ntty10 tty45\r\ntty11 tty46\r\n(initramfs) cat /proc/cmdline\r\nbcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 dma.dmachans=0x7f35 bcm2709.boardrev=0xa02082 bcm2709.serial=0xfaf144 bcm2709.uart_clock=48000000 smsc95xx.macaddr=B8:27:EB:FA:F1:44 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=tty0 console=ttyS1,115200 root=/dev/mmcblk0p2 rw elevator=deadline fsck.repair=yes net.ifnames=0 cma=64M rootwait\r\n\n/boot \u3092 mount \u3057\u3066\u66f8\u304d\u63db\u3048\u3088\u3046\u3068\u601d\u3063\u305f\u3051\u3069\u3046\u307e\u304f mount \u51fa\u6765\u306a\u3044?
\n(initramfs) mkdir /tmp/boot\r\n(initramfs) mount /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: Invalid argument\r\n(initramfs) ls -la /dev/sda1 /tmp/boot\r\nbrw------- 1 0 0 8, 1 Jan 1 00:00 /dev/sda1\r\n\r\n/tmp/boot:\r\ntotal 0\r\ndrwxr-xr-x 2 0 0 0 Jan 1 00:10 .\r\ndrwxr-xr-x 3 0 0 0 Jan 1 00:10 ..\r\n(initramfs) mount -t vfat /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: No such device\r\n(initramfs) mkdir /tmp/root\r\n(initramfs) modprobe ext4\r\n(initramfs) mount /dev/sda2 /tmp/root\r\n[ 2144.515323] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)\r\n(initramfs) find /tmp/root -name "vfat.ko"\r\n/tmp/root/usr/lib/modules/4.19.0-2-arm64/kernel/fs/fat/vfat.ko\r\n(initramfs) modprobe -v /tmp/root/usr/lib/modules/4.19.0-2-arm64/kernel/fs/fat/vfat.ko\r\n(initramfs) lsmod|grep fat\r\n(initramfs) mount -t vfat /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: No such device\r\n(initramfs) lsmod|grep fat\r\n\n\u4e00\u65e6\u96fb\u6e90\u3092\u5207\u3063\u3066 /boot/cmdline.txt \u306e root=/dev/mmcblk0p2 \u3092 root=/dev/sda2 \u306b\u66f8\u304d\u63db\u3048\u3066\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\uff0e(LABEL\u6307\u5b9a\u306b\u5909\u3048\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u306a)
\n$ cat /boot/firmware/cmdline.txt \r\nconsole=tty0 console=ttyS1,115200 root=/dev/sda2 rw elevator=deadline fsck.repair=yes net.ifnames=0 cma=64M rootwait\r\n\n\u203braspi3-firmware \u3042\u305f\u308a\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u639b\u304b\u308b\u3068\u4e0a\u66f8\u304d\u3055\u308c\u308b\u3088\u3046\uff0e
\nsystemd \u304b\u3089 sysvinit \u306b\u5909\u66f4(RAM\u304c\u958b\u304f\u304b\u3068\u601d\u3063\u305f\u3051\u3069\u6570MB\u7a0b\u5ea6\u3060\u3063\u305f)
\n$ sudo apt install sysvinit-core sysvinit-utils\r\n\nLANG\u3092\u8a2d\u5b9a
\nen_US.UTF-8 UTF-8, ja_JP.UTF-8 UTF-8 \u3092\u6709\u52b9\u306b\u3057\u3066\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u30ed\u30b1\u30fc\u30eb\u3092 ja_JP.UTF-8 \u306b\u3057\u305f\u308a\u3057\u305f\uff0e
$ sudo dpkg-reconfigure locales\r\n$ echo 'export LANG="ja_JP.UTF-8"\r\nexport LC_TIME="en_US.UTF-8"' | tee -a ~/.profile\r\n$ source ~/.profile\r\n$ locale\r\nLANG=ja_JP.UTF-8\r\nLANGUAGE=\r\nLC_CTYPE="ja_JP.UTF-8"\r\nLC_NUMERIC="ja_JP.UTF-8"\r\nLC_TIME=en_US.UTF-8\r\nLC_COLLATE="ja_JP.UTF-8"\r\nLC_MONETARY="ja_JP.UTF-8"\r\nLC_MESSAGES="ja_JP.UTF-8"\r\nLC_PAPER="ja_JP.UTF-8"\r\nLC_NAME="ja_JP.UTF-8"\r\nLC_ADDRESS="ja_JP.UTF-8"\r\nLC_TELEPHONE="ja_JP.UTF-8"\r\nLC_MEASUREMENT="ja_JP.UTF-8"\r\nLC_IDENTIFICATION="ja_JP.UTF-8"\r\nLC_ALL=\r\n\nRaspberry Pi \u306b\u306f rtc \u304c\u306a\u304f\u3066\u518d\u8d77\u52d5\u306a\u3069\u3067\u6642\u8a08\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3057\u307e\u3046\u306e\u3067 fake-hwclock \u3092\u5c0e\u5165(\u96fb\u6e90\u65ad\u6642\u306a\u3069\u306e\u6642\u9593\u306f\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u306a\u3044\u306e\u3067\u6642\u9593\u304c\u305a\u308c\u308b\u304c\u6642\u8a08\u304c\u5dfb\u304d\u623b\u3089\u306a\u3044)
\n$ sudo apt install fake-hwclock\r\n\nntpdate \u3092\u5c0e\u5165\u3057\u3066\u8d77\u52d5\u6642\u306e\u6642\u8a08\u5408\u308f\u305b\u3092\u3059\u308b\u3088\u3046\u306b\u3059\u308b(systemd\u306e\u307e\u307e\u3060\u3068ntp\u306e\u9762\u5012\u3092\u898b\u3066\u304f\u308c\u308b\u306e\u3067\u5fc5\u8981\u306a\u3044)
\n$ sudo apt install ntpdate\r\n$ sudo vi /etc/boot.d/ntpdate\r\n$ cat /etc/boot.d/ntpdate\r\n#!/bin/sh\r\n\r\nntpdate 1.jp.pool.ntp.org\r\n$ sudo chmod +x /etc/boot.d/ntpdate\r\n\nntpdate iptables \u306b\u5408\u308f\u305b\u3066\u3053\u3063\u3061\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082?(\u6709\u7dda\u63a5\u7d9a\u5f8c\u306b\u6642\u8a08\u5408\u308f\u305b\u3059\u308b)
\n$ cat /etc/network/interfaces.d/eth0 \r\nauto eth0\r\n\r\n# TODO: switch back to iptables-persistent once it re-enters testing\r\niface eth0 inet dhcp\r\n pre-up iptables-restore < /etc/iptables/rules.v4\r\n pre-up ip6tables-restore < /etc/iptables/rules.v6\r\n up ntpdate 1.jp.pool.ntp.org\r\n\nuart\u3067setial\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b /etc/inittab \u306b\u4ee5\u4e0b\u3092\u8a2d\u5b9a(systemd\u3060\u3068\u8a2d\u5b9a\u6e08\u307f\u306a\u306e\u3067\u4e0d\u8981)
T1:23:respawn:/sbin/getty -L ttyS1 115200 vt100\r\n\nmsmtp\u3092\u5c0e\u5165\u3057\u3066\u30e1\u30fc\u30eb\u3092\u98db\u3070\u305b\u308b\u3088\u3046\u306b
\n$ sudo apt install msmtp\r\n$ sudo vi /etc/msmtprc\r\n$ grep -v ^# /etc/msmtprc|uniq\r\ndefaults\r\nsyslog on\r\naliases /etc/aliases\r\n\r\ntls on\r\ntls_trust_file /etc/ssl/certs/ca-certificates.crt\r\nauth on\r\nsyslog LOG_MAIL\r\n\r\naccount gmail\r\nhost smtp.gmail.com\r\nport 587\r\nfrom matohara@gmail.com\r\nuser matohara\r\npassword throjfeekdewxeib\r\n\r\naccount default : gmail\r\n$ sudo vi /etc/aliases\r\n$ grep -v ^# /etc/aliases\r\nmailer-daemon:hoge@example.com\r\npostmaster:hoge@example.com\r\nnobody:hoge@example.com\r\nhostmaster:hoge@example.com\r\nusenet:hoge@example.com\r\nnews:hoge@example.com\r\nwebmaster:hoge@example.com\r\nwww:hoge@example.com\r\nftp:hoge@example.com\r\nabuse:hoge@example.com\r\nnoc:hoge@example.com\r\nsecurity:hoge@example.com\r\nroot: hoge@example.com\r\ndefault: hoge@example.com\r\n$ echo 'hello' | msmtp matoken@ya.ru\r\n$ sudo apt install msmtp-mta\r\n$ echo 'hello' | /usr/sbin/sendmail matoken@ya.ru\r\n\n\u7121\u7dda\u3092\u7121\u52b9\u306b\u3059\u308b\u305f\u3081\u306b /boot/firmware/config.txt \u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u2026\u2026\u518d\u8d77\u52d5\u3057\u3066\u3082\u53cd\u6620\u3055\u308c\u306a\u3044?\u8981\u78ba\u8a8d
dtoverlay=pi3-disable-wifi\r\ndtoverlay=pi3-disable-bt\r\n\napticron \u3092\u5c0e\u5165\u3057\u3066\u66f4\u65b0\u3092\u30e1\u30fc\u30eb\u3067\u901a\u77e5\u3059\u308b
\n$ sudo apt install apticron\r\n$ sudo cp -p /usr/lib/apticron/apticron.conf /etc/apticron/\r\n$ grep ^EMAIL= /etc/apticron/apticron.conf #\u5fc5\u8981\u306a\u3089\u5b9b\u5148\u3092\u66f8\u304d\u63db\u3048\u305f\u308a\r\nEMAIL="root"\r\n\ndeborphan \u3067\u307f\u306a\u3057\u3054\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u901a\u77e5\u3059\u308b\u3088\u3046\u306b\u3059\u308b
\n$ sudo apt install deborphan\r\n$ sudo crontab -e\r\n$ sudo crontab -l | grep deborphan | grep -v ^#\r\n7 4 * * * deborphan && printf "\\nsudo apt --autoremove purge \\$( deborpha)'\r\n\n\u3066\u3053\u3068\u3067\u3068\u308a\u3042\u3048\u305a\u52d5\u304f\u3088\u3046\u306b\u306a\u3063\u305f\u3051\u3069\u6614\u3082\u3089\u3063\u305f\u30ce\u30d9\u30eb\u30c6\u30a3\u306eUSB\u30e1\u30e2\u30ea\u306a\u306e\u3067\u3053\u306e\u307e\u307e\u904b\u7528\u3059\u308b\u3068\u591a\u5206\u3059\u3050\u58ca\u308c\u3066\u3057\u307e\u3046\u3068\u601d\u3044\u307e\u3059\uff0e
\n\u6700\u8fd1\u79cb\u8449\u539f\u3067\u30bb\u30fc\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u69d8\u306a\u5b89\u3044 SSD \u3068\u304b\u6b32\u3057\u3044\u3067\u3059\u306d\uff0e
\u3053\u3061\u3089\u306f\u8d77\u52d5\u7d42\u4e86\u306eUART\u306e\u30e1\u30c3\u30bb\u30fc\u30b8
\n\n\n\n", "content_text": "\u6700\u8fd1\u5165\u624b\u3057\u305f(\u9045) RaspberryPi 3 model B \u3067 USB \u30e1\u30e2\u30ea\u8d77\u52d5\u306e Debian buster aarch64 \u3092\u8a2d\u5b9a\u3057\u3066\u307f\u305f\u3068\u304d\u306e\u30e1\u30e2\u3067\u3059\uff0e\n\u30b8\u30e2\u30c6\u30a3\u30fc\u7d4c\u7531\u3067 Raspberry Pi 3 model B \u3092\u5165\u624b\u3057\u307e\u3057\u305f\uff0eRaspberry Pi 3 model B + USB Wi-Fi + USB Bluetooth + \u30b1\u30fc\u30b9\u306e\u30bb\u30c3\u30c8\u304c2,500\u5186 + \u9001\u6599\u624b\u6570\u6599 500\u5186\u3068\u5b89\u3044\u3067\u3059\uff0e\u666e\u901a\u306b\u65b0\u54c1\u3067\u8cb7\u3046\u3068 8,000\u5186\u8fd1\u304f\u3059\u308b\u3068\u601d\u3044\u307e\u3059\uff0e\u4eca\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u308b\u6642\u70b9\u3067\u672a\u3060\u5728\u5eab\u306f\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u8208\u5473\u306e\u3042\u308b\u4eba\u306f\u8cb7\u3046\u3068\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0e(6\u500b\u540c\u68b1\u53ef\u80fd\u306a\u306e\u3067\u305d\u308c\u3060\u30681\u500b\u3042\u305f\u308a\u304c\u5c11\u3057\u5b89\u304f\u306a\u308b\u306e\u3067\u8fd1\u6240\u306e\u53cb\u9054\u3068\u8cb7\u3046\u3068\u3044\u3044\u304b\u3082)\n\nRaspberry Pi 3 model B \uff0b \u30b1\u30fc\u30b9\uff08\u9ed2\uff09 \uff0b Wi-Fi/Bluetooth \u30a2\u30c0\u30d7\u30bf\u30fc (\u3068\u304f) \u304a\u53f0\u5834\u6d77\u6d5c\u516c\u5712\u306e\u305d\u306e\u4ed6\u306e\u4e2d\u53e4\u3042\u3052\u307e\u3059\u30fb\u8b72\u308a\u307e\u3059\uff5c\u30b8\u30e2\u30c6\u30a3\u30fc\u3067\u4e0d\u7528\u54c1\u306e\u51e6\u5206\n\n\n64bit\u306b\u306a\u3063\u305f Raspberry Pi \u306f\u6b32\u3057\u3044\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u5b89\u304f\u624b\u306b\u5165\u3063\u3066\u52a9\u304b\u308a\u307e\u3057\u305f :)\n(\u5f8c\u7d99\u306e Raspberry Pi 3 Model B+/A+ \u3084\uff0cSoC\u304c 3B \u3068\u540c\u3058\u3067\u7121\u7dda\u6a5f\u80fd\u306e\u306a\u3044 2B v1.2 \u3068\u304b\u3082\u6b32\u3057\u3044\u3067\u3059\u306d\uff0e)\nRaspberry Pi 3 model B \u306f 32bit\u3060\u3051\u3067\u306a\u304f64bit \u3082\u5229\u7528\u3067\u304d\u308b\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u3067\u3059\uff0e\u305b\u3063\u304b\u304f\u306a\u306e\u3067 64bit\u3067\u52d5\u304b\u3057\u305f\u3044\u3051\u3069\u4eca\u306e\u6642\u70b9\u3067\u306f Raspbian \u306f 32bit\u306e\u307f\u3067\u3059\uff0e\u305d\u3053\u3067 Debian \u306e arm64 \u3092\u8a66\u3059\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0e\nRaspberry Pi 3 \u7528 Debian buster arm64 \u30a4\u30e1\u30fc\u30b8\u306e\u5165\u624b\u3068USB\u30e1\u30e2\u30ea\u3078\u306e\u66f8\u304d\u8fbc\u307f\n\u30a4\u30e1\u30fc\u30b8\u306f\u5ca9\u677e\u3055\u3093\u306e\u6771\u4eac\u30a8\u30ea\u30a2Debian\u52c9\u5f37\u4f1a\u306e\u8cc7\u6599\u3092\u771f\u4f3c\u3057\u3066\u4f5c\u308d\u3046\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\uff0c\n\n\u6771\u4eac\u30a8\u30ea\u30a2Debian\u52c9\u5f37\u4f1a\n\nRaspberry Pi 2 Model B \u306b Debian Jessie / armhf \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b – \u7b2c125\u56de 2015\u5e743\u6708\u5ea6\nRaspberry Pi3 / arm64 – Debian/Ubuntu \u30df\u30fc\u30c8\u30a2\u30c3\u30d7 in \u672d\u5e4c\n\n\n\nDebianWiki \u306e RaspberryPi3 \u306e\u9805\u76ee\u3092\u898b\u305f\u3089\u975e\u516c\u5f0f\u3060\u3051\u3069\u30a4\u30e1\u30fc\u30b8\u304c\u3042\u3063\u305f\u306e\u3067\u4eca\u56de\u306f\u305d\u308c\u3092\u5229\u7528\u3057\u307e\u3057\u305f\uff0e\u73fe\u5728 testing \u306e Buster \u306e\u30a4\u30e1\u30fc\u30b8\u304c\u5165\u624b\u3067\u304d\u307e\u3059\uff0e\n\nRaspberryPi3 – Debian Wiki\n\nDebian/raspi3-image-spec: contains the files to build the https://wiki.debian.org/RaspberryPi3 image\n\n\n\n\u30b9\u30c8\u30ec\u30fc\u30b8\u306f\u901a\u5e38 microSD \u3092\u5229\u7528\u3057\u307e\u3059\u304c\uff0c\u624b\u6301\u3061\u304c\u306a\u3044\u306e\u3068 Raspberry Pi 3 B \u306fUSB\u8d77\u52d5\u304c\u53ef\u80fd\u306a\u306f\u305a\u306a\u306e\u3067USB\u30e1\u30e2\u30ea\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\uff0eUSB 2.0\u63a5\u7d9a\u306e\u5bb9\u91cf2GB\u306e\u3082\u306e\u3092\u7528\u610f\u3057\u307e\u3057\u305f\uff0e\n\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u30a4\u30e1\u30fc\u30b8\u3092\u5165\u624b\u3057\u3066\u30cf\u30c3\u30b7\u30e5\u306e\u30c1\u30a7\u30c3\u30af\u3092\u3057\u305f\u5f8cUSB\u30e1\u30e2\u30ea\u3078\u66f8\u304d\u8fbc\u307f\u307e\u3057\u305f\uff0e\u3053\u3053\u3067\u306f Linux\u306edd\u30b3\u30de\u30f3\u30c9\u3067\u66f8\u304d\u8fbc\u3093\u3067\u3044\u307e\u3059\u304c\uff0cEtcher\u306a\u3069\u3092\u5229\u7528\u3059\u308b\u3068\u8272\u3005\u306a\u74b0\u5883\u3067GUI\u3067\u306e\u66f8\u304d\u8fbc\u307f\u304c\u53ef\u80fd\u3067\u3059\uff0e\n\u203b\u30a4\u30e1\u30fc\u30b8\u306f\u6700\u65b0\u306e\u3082\u306e\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\uff0e\n$ wget -c https://people.debian.org/~gwolf/raspberrypi3/20190206/20190206-raspberry-pi-3-buster-PREVIEW.img.xz https://people.debian.org/~gwolf/raspberrypi3/20190206/20190206-raspberry-pi-3-buster-PREVIEW.img.xz.sha256\r\n$ sha256sum -c ./20190206-raspberry-pi-3-buster-PREVIEW.img.xz.sha256\r\n20190206-raspberry-pi-3-buster-PREVIEW.img.xz: \u5b8c\u4e86\r\n$ xzcat 20190206-raspberry-pi-3-buster-PREVIEW.img.xz | pv | sudo dd of=/dev/sdb bs=1M oflag=dsync\r\n\n\nbalenaEtcher – Home\n\u30d6\u30fc\u30bf\u30d6\u30ebUSB\u30e1\u30e2\u30ea\u3092\u4f5c\u308bEtcher\u3092\u8a66\u3059 \u2013 matoken’s meme\n\u30de\u30eb\u30c1USB\u66f8\u304d\u8fbc\u307f\u30c4\u30fc\u30eb\u306ePopsicle \u2013 matoken’s meme\n\u30d6\u30fc\u30c8USB\u30e1\u30e2\u30ea\u306a\u3069\u3092\u4f5c\u308bmkusb\u3092\u8a66\u3057\u3066\u307f\u308b \u2013 matoken’s meme\nLinux \u74b0\u5883\u3067\u306e Raspberry Pi \u5411\u3051 OS \u66f8\u304d\u8fbc\u307fTips \u2013 matoken’s meme\n\nUSB\u304b\u3089\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046OTP\u3092\u8a2d\u5b9a\u3059\u308b\n\u6ce8\u610f:OTP\u306e\u8a2d\u5b9a\u306f1\u5ea6\u3057\u304b\u51fa\u6765\u306a\u3044\u3057\uff0c\u5143\u306b\u623b\u3059\u3053\u3068\u3082\u51fa\u6765\u306a\u3044\u3068\u601d\u308f\u308c\u307e\u3059\uff0e\u8d77\u52d5\u6642\u9593\u304c\u9577\u304f\u306a\u308b\u306a\u3069\u30c7\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308b\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\n\u3053\u306eUSB\u30e1\u30e2\u30ea\u3092 Raspberry Pi \u306b\u63a5\u7d9a\u3057\u3066\u96fb\u6e90\u3092\u5165\u308c\u3066\u307f\u307e\u3057\u305f\u304c\u8d77\u52d5\u3057\u307e\u305b\u3093\uff0e\u6050\u3089\u304f OTP(One Time Programmable)\u30e1\u30e2\u30ea\u306e\u8a2d\u5b9a\u304c USB\u8d77\u52d5\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306b\u8a2d\u5b9a\u3057\u307e\u3059\uff0e(Raspberry Pi 3+ \u30b7\u30ea\u30fc\u30ba\u306f\u6a19\u6e96\u3067USB\u8d77\u52d5\u53ef\u80fd\u306a\u306e\u3067\u3053\u306e\u8a2d\u5b9a\u306f\u4e0d\u8981\u306a\u306f\u305a\u3067\u3059\uff0e)\n\nHow to boot from a USB mass storage device on a Raspberry Pi – Raspberry Pi Documentation\n\n\u5148\u305a Raspbian 2017-04-10 \u4ee5\u964d\u306e\u30a4\u30e1\u30fc\u30b8\u3092\u66f8\u304d\u8fbc\u3093\u3060 microSD \u3092\u7528\u610f\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\uff0e\n( uart\u7d4c\u7531\u3067\u7e4b\u304e\u305f\u3044\u5834\u5408\u8d77\u52d5\u524d\u306b /boot/config.txt \u306b enable_uart=1 \u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\uff0e $ echo enable_uart=1 | tee -a /media/matoken/boot/config.txt )\nOTP \u3092\u78ba\u8a8d\u3059\u308b\u3068\u3084\u306f\u308a\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\uff0e\npi@raspberrypi:~$ vcgencmd otp_dump | grep ^17:\r\n17:1020000a\r\n\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b /boot/config.txt \u306b program_usb_boot_mode=1 \u3092\u8ffd\u8a18\u3057\u3066\u518d\u8d77\u52d5\u3059\u308b\u3068\u53cd\u6620\u3055\u308c\u307e\u3059\uff0e\n$ echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt\r\nprogram_usb_boot_mode=1\r\npi@raspberrypi:~$ sudo reboot\r\n\n17 \u304c 3020000a \u306b\u5909\u308f\u308c\u3070OK\npi@raspberrypi:~$ vcgencmd otp_dump | grep ^17:\r\n17:3020000a\r\n\n\u8a73\u7d30\u306f\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\n\nRaspberry Pi Documentation\n\n17 \u2013 bootmode register\r\n\r\nBit 1: sets the oscillator frequency to 19.2MHz\r\nBit 3: enables pull ups on the SDIO pins\r\nBit 19: enables GPIO bootmode\r\nBit 20: sets the bank to check for GPIO bootmode\r\nBit 21: enables booting from SD card\r\nBit 22: sets the bank to boot from\r\nBit 28: enables USB device booting\r\nBit 29: enables USB host booting (ethernet and mass storage)\r\n\n\u8a2d\u5b9a\u524d\u304c\uff0c1020000a -> 0b010000001000000000000000001010 \u3067\u8a2d\u5b9a\u5f8c\u304c\uff0c0x3020000a -> 0b110000001000000000000000001010 \u3066\u3053\u3068\u3067\uff0cBit 29 \u304c 0 \u304b\u3089 1 \u306b\u306a\u3063\u3066\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8d77\u52d5\u3068USB\u8d77\u52d5\u3092\u8a66\u3059\u3088\u3046\u306b\u308a\u307e\u3059\uff0e\u3053\u306e\u72b6\u614b\u3067 microSD \u8d77\u52d5\u3092\u8a66\u3059\u3068\u3053\u308c\u3082\u5927\u4e08\u592b\u3067\u3057\u305f\uff0e(\u512a\u5148\u5ea6\u306f microSD > USB\uff0cNetwork\u306f\u672a\u78ba\u8a8d)\nUSB\u30e1\u30e2\u30ea\u304b\u3089\u306e\u8d77\u52d5\n\u3053\u306e\u72b6\u614b\u3067 shutdown \u3057\uff0cmicroSD \u3092\u53d6\u308a\u51fa\u3057\u3066 Debian \u306e\u5c0e\u5165\u3057\u305f USB \u30e1\u30e2\u30ea\u3092\u63a5\u7d9a\u3057\u3066\u8d77\u52d5\u3067\u8d77\u52d5\u3057\u307e\u3057\u305f\uff0e(USB\u8d77\u52d5\u306e\u5834\u5408\u306a\u304b\u306a\u304b\u8d77\u52d5\u304c\u59cb\u307e\u3089\u305a\u7126\u3063\u305f\u3051\u306930\u79d2\u307b\u3069\u5f85\u3064\u3068UART\u306b\u30ed\u30b0\u304c\u51fa\u306f\u3058\u3081\u308b\uff0eHDMI\u306e\u51fa\u529b\u306f\u672a\u78ba\u8a8d)\nlogin \u306f root:raspberry\n\u3061\u3083\u3093\u3068 64bit \u3067\u3059 :)\nroot@rpi3:~# uname -a\r\nLinux rpi3 4.19.0-2-arm64 #1 SMP Debian 4.19.16-1 (2019-01-17) aarch64 GNU/Linux\r\n\n\u7d30\u3005\u3068\u3057\u305f\u8a2d\u5b9a(\u307b\u307c\u4f59\u9332)\n\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u66f4\u65b0\nroot@rpi3:~# apt update && apt upgrade\r\n\n\u4e00\u822c\u30e6\u30fc\u30b6\u306e\u8ffd\u52a0\nroot@rpi3:~# useradd -m matoken\r\nroot@rpi3:~# passwd matoken\r\nEnter new UNIX password: \r\nRetype new UNIX password: \r\npasswd: password updated successfully\r\nroot@rpi3:~# chsh matoken -s /bin/bash\r\n\nOpenSSH \u306e\u8a2d\u5b9a\u5909\u66f4\nroot@rpi3:~# diff -u /etc/ssh/sshd_config.old /etc/ssh/sshd_config\r\n--- /etc/ssh/sshd_config.old 2019-02-06 15:15:46.940904823 +0000\r\n+++ /etc/ssh/sshd_config 2019-02-16 13:17:17.076873278 +0000\r\n@@ -29,7 +29,7 @@\r\n # Authentication:\r\n\r\n #LoginGraceTime 2m\r\n-PermitRootLogin yes\r\n+PermitRootLogin prohibit-password\r\n #StrictModes yes\r\n #MaxAuthTries 6\r\n #MaxSessions 10\r\n@@ -53,7 +53,7 @@\r\n #IgnoreRhosts yes\r\n\r\n # To disable tunneled clear text passwords, change to no here!\r\n-#PasswordAuthentication yes\r\n+PasswordAuthentication no\r\n #PermitEmptyPasswords no\r\n\r\n # Change to yes to enable challenge-response passwords (beware issues with\r\n@@ -119,3 +119,5 @@\r\n # AllowTcpForwarding no\r\n # PermitTTY no\r\n # ForceCommand cvs server\r\n+\r\n+AllowGroups sshusers\r\n\nsshusers \u30b0\u30eb\u30fc\u30d7\u3092\u4f5c\u6210\u3057\u3066 ssh login \u51fa\u6765\u308b\u30e6\u30fc\u30b6\u3092\u767b\u9332\nroot@rpi3:~# sudo groupadd sshusers\r\nroot@rpi3:~# sudo usermod -a -G sshusers matoken\r\n\n\u77ed\u3044modulus \u3092\u524a\u9664\u3059\u308b\nroot@rpi3:~# awk '$5>=3071' /etc/ssh/moduli | tee /etc/ssh/moduli.tmp\r\nroot@rpi3:~# wc -l /etc/ssh/moduli /etc/ssh/moduli.tmp\r\n 427 /etc/ssh/moduli\r\n 368 /etc/ssh/moduli.tmp\r\n 795 total\r\nroot@rpi3:~# sudo mv /etc/ssh/moduli.tmp /etc/ssh/moduli\r\n\nhostpc\u304b\u3089ssh\u516c\u958b\u9375\u3092cp\u3057\u3066\u304a\u304f\n$ ssh-copy-id -i ~/.ssh/id_ed25519_pi.pub matoken@rpi3\r\n\nssh\u9375\u30da\u30a2\u3092\u4f5c\u3063\u3066\u304a\u304f\nroot@rpi3:~# sudo -u matoken ssh-keygen -t ed25519\r\n\nsshd \u306e\u518d\u8d77\u52d5\nroot@rpi3:~# systemctl restart ssh\r\n\nssh login\u6642\u306b\u901a\u77e5\u3092\u98db\u3070\u3059\u3088\u3046\u306b\u3057\u3066\u304a\u304f\nroot@rpi3:~# vi /etc/ssh/sshrc\r\nroot@rpi3:~# chmod +x /etc/ssh/sshrc\r\nroot@rpi3:~# cat /etc/ssh/sshrc\r\n#!/bin/sh\r\n\r\n/home/matoken/bin/telegram.sh sshrc:${USER}@`hostname`:${SSH_CONNECTION}\r\n/home/matoken/bin/sms.sh sshrc:${USER}@`hostname`:${SSH_CONNECTION}\r\n\nssh \u3067\u30d1\u30b9\u30ef\u30fc\u30c9\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u305a\uff0c\u9375\u8a8d\u8a3c\u3067\u30ed\u30b0\u30a4\u30f3\u304c\u51fa\u6765\u308b&\u901a\u77e5\u304c\u98db\u3076\u306e\u3092\u78ba\u8a8d\nroot@rpi3:~# ssh root@localhost -o PasswordAuthentication=yes\r\nroot@rpi3:~# ssh matoken@localhost -o PasswordAuthentication=yes\r\nroot@rpi3:~# ssh matoken@localhost -i ~/.ssh/id_ed25519\r\n\n\u81ea\u5206\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u5408\u308f\u305b\u3066 /etc/iptables/rules.v4, /etc/iptables/rules.v6 \u3092\u5909\u66f4\uff0e\nroot@rpi3:~# grep -v ^# /etc/iptables/rules.v4\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -s 127.0.0.0/8 -m comment --comment "RFC3330 loopback" -j ACCEPT\r\n-A INPUT -s 192.168.1.0/24 -m comment --comment "RFC1918 reserved" -j ACCEPT\r\n-A INPUT -p tcp -m tcp --dport 22 -m comment --comment SSH -j REJECT --reject-with icmp-port-unreachable\r\nCOMMIT\r\nroot@rpi3:~# grep -v ^# /etc/iptables/rules.v6\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -s ::1/128 -m comment --comment "RFC3513 loopback" -j ACCEPT\r\n-A INPUT -p tcp -m tcp --dport 22 -m comment --comment SSH -j REJECT --reject-with icmp6-port-unreachable\r\nCOMMIT\r\n\nsudo \u3092\u5c0e\u5165\u3057\u3066\u8a2d\u5b9a\nroot@rpi3:~# apt install sudo\r\n\nsudo group\u306b\u30e6\u30fc\u30b6\u3092\u767b\u9332\nroot@rpi3:~# usermod -a -G sudo matoken\r\n\nsudo \u304c\u5229\u7528\u3067\u304d\u308b\u306e\u3092\u78ba\u8a8d\nmatoken@rpi3:~$ sudo grep ^root: /etc/shadow\r\nsudo: unable to resolve host rpi3: Name or service not known\r\nroot:!..VyaTFxP8kT6:17933:0:99999:7:::\r\n\nroot\u30e6\u30fc\u30b6\u3092\u30ed\u30c3\u30af\n$ sudo passwd -l root \r\nsudo: unable to resolve host rpi3: Name or service not known\r\npasswd: password expiry information changed.\r\nmatoken@rpi3:~$ sudo passwd -S root\r\nsudo: unable to resolve host rpi3: Name or service not known\r\nroot L 02/06/2019 0 99999 7 -1\r\n\nsudo\u6642\u306a\u3069\u306b\u300csudo: unable to resolve host rpi3: Name or service not known\u300d\u3068\u8a00\u308f\u308c\u308b\u306e\u3067 hosts \u306e localhost \u306b rpi3 \u3092\u8ffd\u52a0\nmatoken@rpi3:~$ sudo vi /etc/hosts\r\n127.0.0.1 localhost rpi3\r\n\n\u3053\u3053\u3067\u518d\u8d77\u52d5\u3059\u308b\u3068 rootfs \u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u8a00\u308f\u308c\u8d77\u52d5\u3057\u306a\u3044\uff0e\n(initramfs) Gave up waiting for root file system device. Common problems:\r\n- Boot args (cat /proc/cmdline)\r\n- Check rootdelay= (did the system wait long enough?)\r\n- Missing modules (cat /proc/modules; ls /dev)\r\nALERT! /dev/mmcblk0p2 does not exist. Dropping to a shell!\r\n\r\n\r\nBusyBox v1.27.2 (Debian 1:1.27.2-3) built-in shell (ash)\r\nEnter 'help' for a list of built-in commands.\r\n\ncmdline \u3067\u306f /dev/mmcblkp2 \u304b\u3089\u8d77\u52d5\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u304c\uff0c /dev/sda2 \u304b\u3089\u8d77\u52d5\u3057\u305f\u3044\n(initramfs) ls /dev\r\nblock tty12 tty47\r\nbsg tty13 tty48\r\nbus tty14 tty49\r\nchar tty15 tty5\r\nconsole tty16 tty50\r\ncore tty17 tty51\r\ncpu_dma_latency tty18 tty52\r\ndisk tty19 tty53\r\nfb0 tty2 tty54\r\nfd tty20 tty55\r\nfull tty21 tty56\r\ngpiochip0 tty22 tty57\r\ngpiochip1 tty23 tty58\r\ninput tty24 tty59\r\nkmsg tty25 tty6\r\nkvm tty26 tty60\r\nmem tty27 tty61\r\nmemory_bandwidth tty28 tty62\r\nnetwork_latency tty29 tty63\r\nnetwork_throughput tty3 tty7\r\nnull tty30 tty8\r\nport tty31 tty9\r\npsaux tty32 ttyAMA0\r\nptmx tty33 ttyS0\r\npts tty34 ttyS1\r\nrandom tty35 ttyS2\r\nsda tty36 ttyS3\r\nsda1 tty37 urandom\r\nsda2 tty38 vcs\r\nsnapshot tty39 vcs1\r\nstderr tty4 vcsa\r\nstdin tty40 vcsa1\r\nstdout tty41 vcsu\r\ntty tty42 vcsu1\r\ntty0 tty43 vga_arbiter\r\ntty1 tty44 zero\r\ntty10 tty45\r\ntty11 tty46\r\n(initramfs) cat /proc/cmdline\r\nbcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 dma.dmachans=0x7f35 bcm2709.boardrev=0xa02082 bcm2709.serial=0xfaf144 bcm2709.uart_clock=48000000 smsc95xx.macaddr=B8:27:EB:FA:F1:44 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=tty0 console=ttyS1,115200 root=/dev/mmcblk0p2 rw elevator=deadline fsck.repair=yes net.ifnames=0 cma=64M rootwait\r\n\n/boot \u3092 mount \u3057\u3066\u66f8\u304d\u63db\u3048\u3088\u3046\u3068\u601d\u3063\u305f\u3051\u3069\u3046\u307e\u304f mount \u51fa\u6765\u306a\u3044?\n(initramfs) mkdir /tmp/boot\r\n(initramfs) mount /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: Invalid argument\r\n(initramfs) ls -la /dev/sda1 /tmp/boot\r\nbrw------- 1 0 0 8, 1 Jan 1 00:00 /dev/sda1\r\n\r\n/tmp/boot:\r\ntotal 0\r\ndrwxr-xr-x 2 0 0 0 Jan 1 00:10 .\r\ndrwxr-xr-x 3 0 0 0 Jan 1 00:10 ..\r\n(initramfs) mount -t vfat /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: No such device\r\n(initramfs) mkdir /tmp/root\r\n(initramfs) modprobe ext4\r\n(initramfs) mount /dev/sda2 /tmp/root\r\n[ 2144.515323] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)\r\n(initramfs) find /tmp/root -name "vfat.ko"\r\n/tmp/root/usr/lib/modules/4.19.0-2-arm64/kernel/fs/fat/vfat.ko\r\n(initramfs) modprobe -v /tmp/root/usr/lib/modules/4.19.0-2-arm64/kernel/fs/fat/vfat.ko\r\n(initramfs) lsmod|grep fat\r\n(initramfs) mount -t vfat /dev/sda1 /tmp/boot\r\nmount: mounting /dev/sda1 on /tmp/boot failed: No such device\r\n(initramfs) lsmod|grep fat\r\n\n\u4e00\u65e6\u96fb\u6e90\u3092\u5207\u3063\u3066 /boot/cmdline.txt \u306e root=/dev/mmcblk0p2 \u3092 root=/dev/sda2 \u306b\u66f8\u304d\u63db\u3048\u3066\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\uff0e(LABEL\u6307\u5b9a\u306b\u5909\u3048\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u306a)\n$ cat /boot/firmware/cmdline.txt \r\nconsole=tty0 console=ttyS1,115200 root=/dev/sda2 rw elevator=deadline fsck.repair=yes net.ifnames=0 cma=64M rootwait\r\n\n\u203braspi3-firmware \u3042\u305f\u308a\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u639b\u304b\u308b\u3068\u4e0a\u66f8\u304d\u3055\u308c\u308b\u3088\u3046\uff0e\n\nRevert “Fix the cmdline.txt options to boot by label, not by partition” by chschlue \u00b7 Pull Request #33 \u00b7 Debian/raspi3-image-spec\n#903543 – raspi3-firmware: add configuration options for cmdline.txt – Debian Bug report logs\n\nsystemd \u304b\u3089 sysvinit \u306b\u5909\u66f4(RAM\u304c\u958b\u304f\u304b\u3068\u601d\u3063\u305f\u3051\u3069\u6570MB\u7a0b\u5ea6\u3060\u3063\u305f)\n$ sudo apt install sysvinit-core sysvinit-utils\r\n\nLANG\u3092\u8a2d\u5b9a\nen_US.UTF-8 UTF-8, ja_JP.UTF-8 UTF-8 \u3092\u6709\u52b9\u306b\u3057\u3066\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u30ed\u30b1\u30fc\u30eb\u3092 ja_JP.UTF-8 \u306b\u3057\u305f\u308a\u3057\u305f\uff0e\n$ sudo dpkg-reconfigure locales\r\n$ echo 'export LANG="ja_JP.UTF-8"\r\nexport LC_TIME="en_US.UTF-8"' | tee -a ~/.profile\r\n$ source ~/.profile\r\n$ locale\r\nLANG=ja_JP.UTF-8\r\nLANGUAGE=\r\nLC_CTYPE="ja_JP.UTF-8"\r\nLC_NUMERIC="ja_JP.UTF-8"\r\nLC_TIME=en_US.UTF-8\r\nLC_COLLATE="ja_JP.UTF-8"\r\nLC_MONETARY="ja_JP.UTF-8"\r\nLC_MESSAGES="ja_JP.UTF-8"\r\nLC_PAPER="ja_JP.UTF-8"\r\nLC_NAME="ja_JP.UTF-8"\r\nLC_ADDRESS="ja_JP.UTF-8"\r\nLC_TELEPHONE="ja_JP.UTF-8"\r\nLC_MEASUREMENT="ja_JP.UTF-8"\r\nLC_IDENTIFICATION="ja_JP.UTF-8"\r\nLC_ALL=\r\n\nRaspberry Pi \u306b\u306f rtc \u304c\u306a\u304f\u3066\u518d\u8d77\u52d5\u306a\u3069\u3067\u6642\u8a08\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3057\u307e\u3046\u306e\u3067 fake-hwclock \u3092\u5c0e\u5165(\u96fb\u6e90\u65ad\u6642\u306a\u3069\u306e\u6642\u9593\u306f\u30ab\u30a6\u30f3\u30c8\u3055\u308c\u306a\u3044\u306e\u3067\u6642\u9593\u304c\u305a\u308c\u308b\u304c\u6642\u8a08\u304c\u5dfb\u304d\u623b\u3089\u306a\u3044)\n$ sudo apt install fake-hwclock\r\n\nntpdate \u3092\u5c0e\u5165\u3057\u3066\u8d77\u52d5\u6642\u306e\u6642\u8a08\u5408\u308f\u305b\u3092\u3059\u308b\u3088\u3046\u306b\u3059\u308b(systemd\u306e\u307e\u307e\u3060\u3068ntp\u306e\u9762\u5012\u3092\u898b\u3066\u304f\u308c\u308b\u306e\u3067\u5fc5\u8981\u306a\u3044)\n$ sudo apt install ntpdate\r\n$ sudo vi /etc/boot.d/ntpdate\r\n$ cat /etc/boot.d/ntpdate\r\n#!/bin/sh\r\n\r\nntpdate 1.jp.pool.ntp.org\r\n$ sudo chmod +x /etc/boot.d/ntpdate\r\n\nntpdate iptables \u306b\u5408\u308f\u305b\u3066\u3053\u3063\u3061\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082?(\u6709\u7dda\u63a5\u7d9a\u5f8c\u306b\u6642\u8a08\u5408\u308f\u305b\u3059\u308b)\n$ cat /etc/network/interfaces.d/eth0 \r\nauto eth0\r\n\r\n# TODO: switch back to iptables-persistent once it re-enters testing\r\niface eth0 inet dhcp\r\n pre-up iptables-restore < /etc/iptables/rules.v4\r\n pre-up ip6tables-restore < /etc/iptables/rules.v6\r\n up ntpdate 1.jp.pool.ntp.org\r\n\nuart\u3067setial\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b /etc/inittab \u306b\u4ee5\u4e0b\u3092\u8a2d\u5b9a(systemd\u3060\u3068\u8a2d\u5b9a\u6e08\u307f\u306a\u306e\u3067\u4e0d\u8981)\nT1:23:respawn:/sbin/getty -L ttyS1 115200 vt100\r\n\nmsmtp\u3092\u5c0e\u5165\u3057\u3066\u30e1\u30fc\u30eb\u3092\u98db\u3070\u305b\u308b\u3088\u3046\u306b\n$ sudo apt install msmtp\r\n$ sudo vi /etc/msmtprc\r\n$ grep -v ^# /etc/msmtprc|uniq\r\ndefaults\r\nsyslog on\r\naliases /etc/aliases\r\n\r\ntls on\r\ntls_trust_file /etc/ssl/certs/ca-certificates.crt\r\nauth on\r\nsyslog LOG_MAIL\r\n\r\naccount gmail\r\nhost smtp.gmail.com\r\nport 587\r\nfrom matohara@gmail.com\r\nuser matohara\r\npassword throjfeekdewxeib\r\n\r\naccount default : gmail\r\n$ sudo vi /etc/aliases\r\n$ grep -v ^# /etc/aliases\r\nmailer-daemon:hoge@example.com\r\npostmaster:hoge@example.com\r\nnobody:hoge@example.com\r\nhostmaster:hoge@example.com\r\nusenet:hoge@example.com\r\nnews:hoge@example.com\r\nwebmaster:hoge@example.com\r\nwww:hoge@example.com\r\nftp:hoge@example.com\r\nabuse:hoge@example.com\r\nnoc:hoge@example.com\r\nsecurity:hoge@example.com\r\nroot: hoge@example.com\r\ndefault: hoge@example.com\r\n$ echo 'hello' | msmtp matoken@ya.ru\r\n$ sudo apt install msmtp-mta\r\n$ echo 'hello' | /usr/sbin/sendmail matoken@ya.ru\r\n\n\u7121\u7dda\u3092\u7121\u52b9\u306b\u3059\u308b\u305f\u3081\u306b /boot/firmware/config.txt \u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u2026\u2026\u518d\u8d77\u52d5\u3057\u3066\u3082\u53cd\u6620\u3055\u308c\u306a\u3044?\u8981\u78ba\u8a8d\ndtoverlay=pi3-disable-wifi\r\ndtoverlay=pi3-disable-bt\r\n\napticron \u3092\u5c0e\u5165\u3057\u3066\u66f4\u65b0\u3092\u30e1\u30fc\u30eb\u3067\u901a\u77e5\u3059\u308b\n$ sudo apt install apticron\r\n$ sudo cp -p /usr/lib/apticron/apticron.conf /etc/apticron/\r\n$ grep ^EMAIL= /etc/apticron/apticron.conf #\u5fc5\u8981\u306a\u3089\u5b9b\u5148\u3092\u66f8\u304d\u63db\u3048\u305f\u308a\r\nEMAIL="root"\r\n\ndeborphan \u3067\u307f\u306a\u3057\u3054\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u901a\u77e5\u3059\u308b\u3088\u3046\u306b\u3059\u308b\n$ sudo apt install deborphan\r\n$ sudo crontab -e\r\n$ sudo crontab -l | grep deborphan | grep -v ^#\r\n7 4 * * * deborphan && printf "\\nsudo apt --autoremove purge \\$( deborpha)'\r\n\n\u3066\u3053\u3068\u3067\u3068\u308a\u3042\u3048\u305a\u52d5\u304f\u3088\u3046\u306b\u306a\u3063\u305f\u3051\u3069\u6614\u3082\u3089\u3063\u305f\u30ce\u30d9\u30eb\u30c6\u30a3\u306eUSB\u30e1\u30e2\u30ea\u306a\u306e\u3067\u3053\u306e\u307e\u307e\u904b\u7528\u3059\u308b\u3068\u591a\u5206\u3059\u3050\u58ca\u308c\u3066\u3057\u307e\u3046\u3068\u601d\u3044\u307e\u3059\uff0e\n\u6700\u8fd1\u79cb\u8449\u539f\u3067\u30bb\u30fc\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u69d8\u306a\u5b89\u3044 SSD \u3068\u304b\u6b32\u3057\u3044\u3067\u3059\u306d\uff0e\n\u3053\u3061\u3089\u306f\u8d77\u52d5\u7d42\u4e86\u306eUART\u306e\u30e1\u30c3\u30bb\u30fc\u30b8", "date_published": "2019-03-01T06:41:13+09:00", "date_modified": "2019-03-01T09:20:00+09:00", "authors": [ { "name": "matoken", "url": "https://matoken.org/blog/author/matoken/", "avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g" } ], "author": { "name": "matoken", "url": "https://matoken.org/blog/author/matoken/", "avatar": "https://secure.gravatar.com/avatar/38f5f3b575c5eb45cda6aa659bca119ac7a5e16b46565e869d0030e3bd66981d?s=512&d=mm&r=g" }, "tags": [ "Debian", "Debian buster", "Raspberry Pi 3 B", "RaspberryPi", "buster", "Linux", "Raspberry Pi" ] } ] }