Debian 7.1 のインストール(5)sudo と telnet のインストール

Debian LS-VL

Debian 7.1 ベースのハックキットに sudo と telnet をインストールしておく。

標準ファームで起動

標準ファームにログイン

Debian のディレクトリツリーに chroot

root@LS-VL815:~# LANG=C.UTF-8 chroot /mnt/debinst /bin/bash
root@LS-VL815:/#

パッケージリストのアップデート

root@LS-VL815:/# apt-get update
Hit http://ftp.jp.debian.org wheezy Release.gpg
Hit http://ftp.jp.debian.org wheezy Release
Hit http://ftp.us.debian.org wheezy Release.gpg
Hit http://ftp.jp.debian.org wheezy/main armel Packages
Hit http://ftp.jp.debian.org wheezy/main Translation-en
Hit http://ftp.us.debian.org wheezy Release
Get:1 http://security.debian.org wheezy/updates Release.gpg [836 B]
Hit http://ftp.us.debian.org wheezy/main Sources
Get:2 http://security.debian.org wheezy/updates Release [102 kB]
Get:3 http://security.debian.org wheezy/updates/main Sources [37.4 kB]
Get:4 http://security.debian.org wheezy/updates/main armel Packages [60.6 kB]
Get:5 http://security.debian.org wheezy/updates/main Translation-en [40.5 kB]
Fetched 242 kB in 3s (67.0 kB/s)
Reading package lists... Done
root@LS-VL815:/#

sudo のインストール

root@LS-VL815:/# apt-get install sudo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  sudo
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 839 kB of archives.
After this operation, 1833 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main sudo armel 1.8.5p2-1+nmu1 [839 kB]
Fetched 839 kB in 0s (1481 kB/s)
Selecting previously unselected package sudo.
(Reading database ... 13158 files and directories currently installed.)
Unpacking sudo (from .../sudo_1.8.5p2-1+nmu1_armel.deb) ...
Processing triggers for man-db ...
Setting up sudo (1.8.5p2-1+nmu1) ...
root@LS-VL815:/#
すんなり。

telnetd のインストール

inetutils-telnetd のインストール

root@LS-VL815:/# apt-get install inetutils-telnetd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  inetutils-inetd libclass-isa-perl libfile-copy-recursive-perl libshishi0
  libswitch-perl perl perl-modules shishi-common update-inetd
Suggested packages:
  shishi perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl make
  libpod-plainer-perl
The following NEW packages will be installed:
  inetutils-inetd inetutils-telnetd libclass-isa-perl
  libfile-copy-recursive-perl libshishi0 libswitch-perl perl perl-modules
  shishi-common update-inetd
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 7888 kB of archives.
After this operation, 27.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.jp.debian.org/debian/ wheezy/main libclass-isa-perl all 0.36-3 [12.3 kB]
Get:2 http://ftp.jp.debian.org/debian/ wheezy/main perl-modules all 5.14.2-21 [3443 kB]
Get:3 http://ftp.jp.debian.org/debian/ wheezy/main perl armel 5.14.2-21 [3662 kB]
Get:4 http://ftp.jp.debian.org/debian/ wheezy/main libswitch-perl all 2.16-2 [21.0 kB]
Get:5 http://ftp.jp.debian.org/debian/ wheezy/main libfile-copy-recursive-perl all 0.38-1 [20.6 kB]
Get:6 http://ftp.jp.debian.org/debian/ wheezy/main update-inetd all 4.43 [21.8 kB]
Get:7 http://ftp.jp.debian.org/debian/ wheezy/main inetutils-inetd armel 2:1.9-2 [143 kB]
Get:8 http://ftp.jp.debian.org/debian/ wheezy/main shishi-common all 1.0.1-2 [149 kB]
Get:9 http://ftp.jp.debian.org/debian/ wheezy/main libshishi0 armel 1.0.1-2 [252 kB]
Get:10 http://ftp.jp.debian.org/debian/ wheezy/main inetutils-telnetd armel 2:1.9-2 [163 kB]
Fetched 7888 kB in 5s (1415 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libclass-isa-perl.
(Reading database ... 13227 files and directories currently installed.)
Unpacking libclass-isa-perl (from .../libclass-isa-perl_0.36-3_all.deb) ...
Selecting previously unselected package perl-modules.
Unpacking perl-modules (from .../perl-modules_5.14.2-21_all.deb) ...
Selecting previously unselected package perl.
Unpacking perl (from .../perl_5.14.2-21_armel.deb) ...
Selecting previously unselected package libswitch-perl.
Unpacking libswitch-perl (from .../libswitch-perl_2.16-2_all.deb) ...
Selecting previously unselected package libfile-copy-recursive-perl.
Unpacking libfile-copy-recursive-perl (from .../libfile-copy-recursive-perl_0.38-1_all.deb) ...
Selecting previously unselected package update-inetd.
Unpacking update-inetd (from .../update-inetd_4.43_all.deb) ...
Selecting previously unselected package inetutils-inetd.
Unpacking inetutils-inetd (from .../inetutils-inetd_2%3a1.9-2_armel.deb) ...
Selecting previously unselected package shishi-common.
Unpacking shishi-common (from .../shishi-common_1.0.1-2_all.deb) ...
Selecting previously unselected package libshishi0.
Unpacking libshishi0 (from .../libshishi0_1.0.1-2_armel.deb) ...
Selecting previously unselected package inetutils-telnetd.
Unpacking inetutils-telnetd (from .../inetutils-telnetd_2%3a1.9-2_armel.deb) ...
Processing triggers for man-db ...
Setting up libclass-isa-perl (0.36-3) ...
Setting up shishi-common (1.0.1-2) ...
Setting up libshishi0 (1.0.1-2) ...
Setting up libswitch-perl (2.16-2) ...
Setting up perl-modules (5.14.2-21) ...
Setting up perl (5.14.2-21) ...
update-alternatives: using /usr/bin/prename to provide /usr/bin/rename (rename) in auto mode
Setting up libfile-copy-recursive-perl (0.38-1) ...
Setting up update-inetd (4.43) ...
Setting up inetutils-inetd (2:1.9-2) ...
[warn] Not starting internet superserver: no services enabled. ... (warning).
Setting up inetutils-telnetd (2:1.9-2) ...
root@LS-VL815:/#

/etc/inetd.conf の修正

手操作で編集するが、きっと何か有効/無効を編集する ツールが有ると思う。。。
root@LS-VL815:/# cd /etc
root@LS-VL815:/etc# grep telnet inetd.conf
## telnet  stream  tcp     nowait  root    /usr/sbin/telnetd       telnetd
root@LS-VL815:/etc# mv inetd.conf inetd.conf.orig
root@LS-VL815:/etc# sed -e 's/^## telnet/telnet/' inetd.conf.orig > inetd.conf
root@LS-VL815:/etc# grep telnet inetd.conf
telnet  stream  tcp     nowait  root    /usr/sbin/telnetd       telnetd
root@LS-VL815:/etc# ls -l inetd.conf*
-rw-r--r-- 1 root root 1112 Jun 28 14:52 inetd.conf
-rw-r--r-- 1 root root 1120 Jun 28 14:41 inetd.conf.orig
root@LS-VL815:/etc# rm inetd.conf.orig
root@LS-VL815:/etc#

掃除

root@LS-VL815:/etc# apt-get clean
root@LS-VL815:/etc# exit
exit
root@LS-VL815:~#

アーカイブの作り直し

root@LS-VL815:~# cd /mnt/debinst/
root@LS-VL815:/mnt/debinst# tar zcvf /mnt/disk1/share/hackkit/hackkit_130628.tar.gz .
./
./srv/
./media/
./bin/
./bin/mountpoint
./bin/grep
./bin/ls
./bin/su
./bin/lesspipe
	:
	:
./run/network/
./mnt/
root@LS-VL815:/mnt/debinst#

インストーラの作り直し

root@LS-VL815:/mnt/debinst# cd /mnt/disk1/share/hackkit/
root@LS-VL815:/mnt/disk1/share/hackkit# sed -e 's/130621/130628/' hackkit_wheezy_130621.sh  > hackkit_wheezy_130628.sh
root@LS-VL815:/mnt/disk1/share/hackkit# grep 1306 hackkit_wheezy_130628.sh
HACKKIT=$WORK/hackkit_wheezy_130628.tar.gz
root@LS-VL815:/mnt/disk1/share/hackkit#
とりあえずここまで

LS-VL

楽天市場
Amazon
livedoor デパート
バッファローダイレクト
Yahoo!ショッピング


準備完了??
ハックの記録
LinkStation/玄箱 をハックしよう

LS410D 入手

ツイート Tweet to @yasunari_y @yasunari_yをフォロー

Copyright (C) 2003-2013 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市