散歩

Debian さくらのVPS

Debian が動いていることはわかったが、
一体中身はどうなっている??
yasunari@sakura:~$ su - root
窿鴻・若        :
root@sakura:~# export LANG=C
root@sakura:~#

ネットワーク

インストール時に IP アドレスも聞かれなかったし。。。
NIC が認識されなかったんじゃないかという疑いが。。。
root@sakura:~# ifconfig
-su: ifconfig: command not found
root@sakura:~# ifconfig -a
-su: ifconfig: command not found
root@sakura:~# /sbin/ifconfig
-su: /sbin/ifconfig: No such file or directory
root@sakura:~#
ifconfig の無い Linux って初めてかも。

root@sakura:~# netstat
-su: netstat: command not found
root@sakura:~# route
-su: route: command not found
root@sakura:~#
netstat も route も無い。
ネットワーク関連のパッケージが根こそぎ入っていない??

root@sakura:~# ping
Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface]
            [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
            [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
            [-w deadline] [-W timeout] [hop1 ...] destination
Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
             [-l preload] [-m mark] [-M pmtudisc_option]
             [-N nodeinfo_option] [-p pattern] [-Q tclass] [-s packetsize]
             [-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline]
             [-W timeout] destination
root@sakura:~#
ping はある。
試しに自宅サーバに Ping を打ってみる。。
root@sakura:~# ping www.yamasita.jp
PING ns.yamasita.jp (122.249.159.72) 56(84) bytes of data.
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=1 ttl=52 time=44.3 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=2 ttl=52 time=38.0 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=3 ttl=52 time=56.9 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=4 ttl=52 time=54.6 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=5 ttl=52 time=38.5 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=6 ttl=52 time=32.9 ms
64 bytes from x159072.ppp.asahi-net.or.jp (122.249.159.72): icmp_seq=7 ttl=52 time=53.7 ms
^C
--- ns.yamasita.jp ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6009ms
rtt min/avg/max/mdev = 32.984/45.614/56.969/8.816 ms
root@sakura:~#
へ?ネットワークにつながっている。
root@sakura:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens3
iface ens3 inet static
        address xxx.xxx.xxx.xxx/23
        gateway yyy.yyy.yyy.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 133.242.0.3 133.242.0.4
        dns-search yamasita.jp

iface ens3 inet6 static
        address 9999:9999:9999:9999:9999
        netmask 64
        gateway fe80::1
        dns-nameservers 2401:2500::1
root@sakura:~#
ちゃんと IP アドレスがセットされている(一部伏せ字)
eth0 ではなくて ens3 なのは udev か?

ひょっとして、外からもつながる??
ssh で繋いでみた。

Linux sakura 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jan 29 19:20:00 2018
yasunari@sakura:~$
うぉー。つながった!

でも、標準ポートで、かつパスワード認証って、超危険!

バージョン他

root@sakura:~# uname -a
Linux sakura 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
root@sakura:~# cat /etc/debian_version
9.1
root@sakura:~#
アップグレード必要

停止
山下康成の
雲の上

ssh の設定

Copyright (C) 2003-2018 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市/東京都新宿区