戻る
1.First Setup「標準となる基本形をインストール」 2012.9.7
1.0. | SDカードのバックアップ |
1.1. | 接続 |
1.2. | 電源投入/立ち上げ |
1.3. | Rootの設定(パスワードの登録) |
1.4. | 日本語キーボードの登録(変更) |
1.5. | userの設定/登録 |
1.6. | パスワードの変更(master passwd) |
1.7. | ネットワークの確認/固定ipアドレス設定 |
1.8. | sshの設定(PCから操作する為) |
1.9. | 日時の設定 |
1.10. | sambaの設定 |
1.11. | ホスト名の変更 |
1.12. | FTP接続設定 |
1.13. | 時計を合わせる[NTP]に関する設定 |
1.14. | GPIOピンを使った通信の為の設定 |
1.15. | 作成したOSのバックアップ |
ligin: pi passwd: raspberry pi@raspberry:/$ |
pi@raspberrypi:/$ sudo passwd root Enter new UNIX password: xxxxxx Retype new UNIX password: xxxxxx passwd: password updated successfully |
pi@raspberry:/$ su password: xxxxxx root@raspberrypi:/# nano /etc/default/keyboard //エディター「nano」で編集する XKBMODEL = "jp106" XKBLAYOUT="jp" root@raspberry:/# shutdown -r now // reboot |
root@raspberry:/# useradd -D // デフォルト設定を確認する GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/sh SKEL=/etc/skel CREATE_MAIL_SPOOL=no |
root@raspberry:/# useradd yyyyy // 新規ユーザーを追加する root@raspberry:/# id -a yyyyy // 確認する uid=1002(yyyyy) gid=1002(yyyyy) groups=1002(yyyyy) root@raspberry:/# passwd yyyyy //「パスワード」を登録する Enter new UNIX password: ppppp retype new UNIX password: ppppp passwd: password update successfully |
loot@raspberrypi:/# passwd pi Changing password for pi. (current) UNIX password: raspberry Enter new UNIX password: xxxxxxxxxx // 8文字以上?? Retype new UNIX password: xxxxxxxxxx passwd: password updated successfully |
root@raspberry:/# ifconfg eth0 Link..... inet addr:192.168.0.xxx // DHCPのxxxを確認する lo Link..... |
c:\> ping 192.168.0.xxx // 現状のip-addressの接続を確認する |
root@raspberry:# cd /etc/netwark root@raspberry:# cp interfaces interfaces.original root@raspberry:# nano interfaces // [nano]を使って以下のように修正する auto lo iface lo inet loopback auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 192.168.0.xyz netmask 255.255.255.0 gateway 192.168.0.1 auto eth0 |
root@raspberry:# apt-get update root@raspberry:# apt-get install ssh |
root@raspberry:# bash ssh-keygen // (エンター3回位) root@raspberry:# ls /root/.ssh // RSAパスワードのファイルがあるかを確認する |
root@raspberry:# service ssh start |
root@raspberry:# update-rc.d ssh defaults |
root@raspberry:# ps -C sshd PID TTY TIME CMD nnn ? 00:00:00 sshd // このように表示されたらOK |
root@raspberry:# date root@raspberry:# Tsu Sep 9 04:05:10 UST 2012 root@raspberry:# mv /etc/localtime /etc/localtime.org root@raspberry:# ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime root@raspberry:# date root@raspberry:# Tsu Sep 9 13:13:08 JST 2012 root@raspberry:# date --set="2012/09/09 13:15" |
root@raspberry:# apt-get apdate root@raspberry:# apt-get install samba root@raspberry:# cd /etc/samba root@raspberry:# nano smb.conf // nano で編集する [grobal] workgroup = workgroup server string = Samba %v # log file = /var/log/samba/log.%m //<== SDカードなのでlogはとらない security = share dos charset = CP932 // 追加 unix charset = UTF-8 // 追加 display charset = EUC-JP // 追加 //共有エリアの設定・以下の記述を追加する。 [root] comment = Public space;anyone can write any files. path = / guest ok = yes writable = yes share modes = workgroup force create mode = 0744 force directory mode = 0755 [homes] writable = yes create mask = 0644 directory mask = 0755 root@raspberry:# testparm // 編集した結果をテストする root@raspberry:# /etc/init.d/samba restart |
root@raspberry:# nano /etc/hostname // nano で編集する raspberry ==> pi-170 // 新しいホスト名をセット |
root@pi-170:# apt-get install vsftpd root@pi-170:# nano /etc/vsftpd.conf 以下の値のみコメントを有効にする listen=YES anonymous_enable=NO local_enable=YES write_enable=YES dirmessage_enable=YES connect_from_port_20=YES ascii_upload_enable=YES ascii_download_enable=YES secure_chroot_dir=/var/run/vsftpd pam_service_name=vsftpd rsa_cert_file=/etc/ssl/certs/vsftpd.pem |
トップに戻る
1.13.時計を合わせる[NTP]に関する設定
nanoで/etc/ntp.confを編集
server 0. 〜 server 3. を#でコメントアウト。
「 pool ntp.nict.jp iburst」を追加
root@pi-170:# nano /etc/ntp.conf # You do need to talk to an NTP server or two (or three). #server ntp.your-provider.example # pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will # pick a different set every time it starts up. Please consider joining the # pool: <http://www.pool.ntp.org/join.html> #server 0.debian.pool.ntp.org iburst #server 1.debian.pool.ntp.org iburst #server 2.debian.pool.ntp.org iburst #server 3.debian.pool.ntp.org iburst pool ntp.nict.jp iburst root@pi-170:# /etc/init.d/ntp restart |
以下で確認する
root@pi-170:# ntpq -p |
1.14.GPIOピンを使った通信の為の設定
RaspberryPiのGPIOピンにはシリアル機能を持ったものがあり、
これを使うことでマイコンと簡単に通信することができる。
コンソールとして使用目的以外でのPiのシリアルポートを使用するためには、
最初のシリアルPiの行をコメントアウトして、
getty(ログインが見て表示するプログラム)を無効にする必要がある。
注意!RaspberryPiに接続するUSB−シリアル変換ICは3.3Vのものを使うこと。
14.1./boot/cmdline.txt を編集する
初期値: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait 編集後: dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait |
root@pi-170:# shutdown -r now |