ssh でログインできるようにする。
sh-3.2# grep -v '^[ ]*#' /etc/sshd_config HostKey /etc/apache/server.key PermitRootLogin no UsePAM yes PermitUserEnvironment yes Subsystem sftp /usr/local/libexec/sftp-server sh-3.2#ホスト鍵の使用あり
ちなみに、grep -v '^[ ]*#' /etc/sshd_config の [ と ] との間はスペースとタブ。
行頭から、スペースかタブかが 0 個以上あって # 、つまりコメントアウトされた行を除く
sh-3.2# cd /etc/ sh-3.2# mv sshd_config{,.orig} sh-3.2# cp sshd_config{.orig,} sh-3.2# vi sshd_config : : sh-3.2# diff !$.orig !$ diff sshd_config.orig sshd_config --- sshd_config.orig Wed Jul 28 20:54:51 2010 +++ sshd_config Wed Oct 13 22:51:24 2010 @@ -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 sh-3.2#
ちなみに !$ は、直前のコマンドの最後の引数。
直前のコマンドは vi sshd_config なので、
diff !$.orig !$ は、
diff sshd_config.orig sshd_config と展開される
sh-3.2# kill -HUP `cat /var/run/sshd.pid ` sh-3.2#で、いいのか?
sil:~# ssh 192.168.2.204 The authenticity of host '192.168.2.204 (192.168.2.204)' can't be established. RSA key fingerprint is 6b:7f:f6:3f:ba:08:5c:65:1a:e3:de:03:27:63:6d:68. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.2.204' (RSA) to the list of known hosts. Password: Password: Password:パスワードが付いていないと駄目なのか??
sh-3.2# passwd Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully sh-3.2#
sil:~# ssh 192.168.2.204 root Password: (上で付けたパスワード) Password:やっぱり駄目。
sil:~# ssh 192.168.2.204 root Password: (上で付けたパスワード) Password:
sh-3.2# tail /var/log/messages : : Oct 13 22:58:41 LS-VL815 sshd[3124]: pam_listfile(sshd:auth): Refused user root for service sshd Oct 13 22:58:45 LS-VL815 sshd[3122]: error: PAM: Authentication failure Oct 13 22:58:45 LS-VL815 sshd[3164]: pam_listfile(sshd:auth): Refused user root for service sshd sh-3.2#PAM が駄目みたい。
sh-3.2# diff -u !$.orig !$ diff -u /etc/sshd_config.orig /etc/sshd_config --- /etc/sshd_config.orig Wed Jul 28 20:54:51 2010 +++ /etc/sshd_config Wed Oct 13 23:01:07 2010 @@ -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 @@ -71,7 +71,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 sh-3.2# kill -HUP `cat /var/run/sshd.pid ` sh-3.2#
sil:~# ssh 192.168.2.204 root root@192.168.2.204's password:(上で付けたパスワード) sh: root: command not found sil:~#だはは
sil:~# ssh 192.168.2.204 root@192.168.2.204's password:(上で付けたパスワード) root@LS-VL815:~#
sil:~# ssh 192.168.2.204 root@192.168.2.204's password: Permission denied, please try again. root@192.168.2.204's password: sil:~#やっぱり、パスワードが付いていないと駄目か、、、
sh-3.2# !diff diff -u /etc/sshd_config.orig /etc/sshd_config --- /etc/sshd_config.orig Wed Jul 28 20:54:51 2010 +++ /etc/sshd_config Wed Oct 13 23:07:06 2010 @@ -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 sh-3.2# !kill kill -HUP `cat /var/run/sshd.pid ` sh-3.2#
sil:~# ssh 192.168.2.204 root@LS-VL815:~#good going!
|
← 散歩 |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ ファームウェア 1.37 のインストール |