ssh でログイン可能化

LS-XHL

きれいになった LS-XHL も ssh でログインできるようにする。
一部、LS-CHL には ssh できなくなったと言っている人もいるようだが、、、

標準ファームの HDD を Debian 化した LS-QL に接続

qube:~# tail -f /var/log/messages
	:
	:

Dec  9 22:21:57 qube kernel: usb 2-1: new high speed USB device using ehci_marvell and address 2
Dec  9 22:21:57 qube kernel: usb 2-1: configuration #1 chosen from 1 choice
Dec  9 22:21:57 qube kernel: scsi2 : SCSI emulation for USB Mass Storage devices
Dec  9 22:22:02 qube kernel: scsi 2:0:0:0: Direct-Access     ViPowER  VP-89118(SD1)    2.10 PQ: 0 ANSI: 4
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: [sdb] 398297088 512-byte hardware sectors (203928 MB)
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: [sdb] Write Protect is off
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: [sdb] 398297088 512-byte hardware sectors (203928 MB)
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: [sdb] Write Protect is off
Dec  9 22:22:02 qube kernel: sdb: sdb1 sdb2 sdb4 < sdb5 sdb6 >
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: [sdb] Attached SCSI disk
Dec  9 22:22:02 qube kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
tail -f を抜けるのは、CTRL-C

/ のマウント

qube:~# mount /dev/sdb2 /tmp/root
qube:~# ls /tmp/root
bin   dev  home    lib  modules  root  sys  usr  www
boot  etc  initrd  mnt  proc     sbin  tmp  var
qube:~#

root のパスワードをつぶす

qube:~# vi /tmp/root/etc/shadow
root のパスワードを消す
qube:~# grep '^root:' !$
grep '^root:' /tmp/root/etc/shadow
root::11009:0:99999:7:::
qube:~#

sshd_config の修正

qube:~# cd /tmp/root/etc
qube:/tmp/root/etc# mv sshd_config{,.orig}
qube:/tmp/root/etc# cp sshd_config{.orig,}
qube:/tmp/root/etc# vi sshd_config
	:
	:
qube:/tmp/root/etc# !cp:s/cp/diff -u/
diff -u sshd_config{.orig,}
--- sshd_config.orig    2010-07-28 20:54:51.000000000 +0900
+++ sshd_config 2010-12-09 22:27:32.230758755 +0900
@@ -20,7 +20,7 @@
 # HostKeys for protocol version 2
 #HostKey /etc/ssh_host_rsa_key
 #HostKey /etc/ssh_host_dsa_key
-HostKey /etc/apache/server.key
+#HostKey /etc/apache/server.key

 # Lifetime and size of ephemeral version 1 server key
 #KeyRegenerationInterval 1h
@@ -35,7 +35,7 @@

 #LoginGraceTime 2m
 #PermitRootLogin yes
-PermitRootLogin no
+PermitRootLogin yes
 #StrictModes yes

 #RSAAuthentication yes
@@ -55,6 +55,7 @@
 # To disable tunneled clear text passwords, change to no here!
 #PasswordAuthentication yes
 #PermitEmptyPasswords no
+PermitEmptyPasswords yes

 # Change to no to disable s/key passwords
 #ChallengeResponseAuthentication yes
@@ -71,7 +72,7 @@
 # Set this to 'yes' to enable PAM authentication (via challenge-response)
 # and session processing. Depending on your PAM configuration, this may
 # bypass the setting of 'PasswordAuthentication'
-UsePAM yes
+UsePAM no

 #AllowTcpForwarding yes
 #GatewayPorts no
qube:/tmp/root/etc#

/ のアンマウント

qube:/tmp/root/etc# cd /
qube:/# umount /tmp/root
qube:/#

LS-QL から抜いて、LS-XHL に戻す

LS-XHL の電源 ON

LS-XHL に ssh

yasunari@sil:~$ ssh -l root brick
The authenticity of host 'brick (192.168.2.49)' can't be established.
RSA key fingerprint is 41:f2:e6:84:4c:bf:9c:e6:fe:d9:d9:66:b7:41:38:23.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'brick,192.168.2.49' (RSA) to the list of known hosts.
root@LS-XHL8DF:~#
good going!

LS-XHL
バッファローダイレクト
楽天市場
amazon
ValuMore


LS-AVL/A, LS-WVL, LS-WXL 値下げ
ハックの記録
LinkStation/玄箱 をハックしよう

散歩

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