エンジニア初心者が躓いたことハマったことを公開します!
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
IPアドレス(アイピーアドレス、英: Internet Protocol address)とは、IPにおいてパケットを送受信する機器を判別するための番号である。
『IPアドレス - Wikipedia』
IPには、IPv4とIPv6とがあり、使用するプロトコルの違いにより、IPv4のIPアドレスとIPv6のIPアドレスとがある。狭義では、当初RFC 791でIPを定義した際に、IPが現在のIPv4に当たるもののみであったことから、単にIPアドレスと呼称した場合にはIPv4のIPアドレスを意味することがある。
『IPアドレス - Wikipedia』
ビット (bit, b) は、ほとんどのデジタルコンピュータが扱うデータの最小単位。英語の binary digit (2進数字)の略であり、2進数の1けたのこと。量子情報科学においては古典ビットと呼ばれる。
1ビットを用いて2通りの状態を表現できる(二元符号)。これらの2状態は一般に"0"、"1"と表記される。
『ビット - Wikipedia』
10進数 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
2進数 | 0 | 1 | 10 | 11 | 100 | 101 | 110 | 111 | 1000 | 1001 | 1010 |
SSHサーバーの初期設定は、22番ポートを利用します。このポート番号は一般的で広く知られているため、不正侵入のリスクが高まります。
『SSHのポート番号を変更 - SSHサーバーの設定』
「セキュリティ上は変えたほうが良いに決まっている」と書いたが、すごく効果があるかは不明だが、変えたほうが良いのは間違いない、という程度の意思表示だ。
『スイーツ(笑)と呼ばないで!! 08/31/16:29 ポートの変更とセキュリティ』
SSHの設定ファイルを「/etc/ssh/sshd_config」ではなく「/etc/ssh/ssh_config」でおこなっていました。
「/etc/ssh/ssh_config」はクライアント側の設定で、「/etc/ssh/sshd_config」はサーバー側の設定ファイルとなります。
今回は、外部からのSSH接続のための設定ですので「/etc/ssh/sshd_config」を変更する必要があります。
同じ階層にあるので、間違ってしましました!
sshとsshdの違いの詳細は下記の通りです。
man ssh
SSH(1) BSD General Commands Manual SSH(1)
NAME
ssh - OpenSSH SSH client (remote login program)
~ (略) ~
DESCRIPTION
ssh (SSH client) is a program for logging into a remote machine and for
executing commands on a remote machine. It is intended to replace rlogin
and rsh, and provide secure encrypted communications between two
untrusted hosts over an insecure network. X11 connections and arbitrary
TCP ports can also be forwarded over the secure channel.
ssh connects and logs into the specified hostname (with optional user
name). The user must prove his/her identity to the remote machine using
one of several methods depending on the protocol version used (see
below).
SSHD(8) BSD System Manager’s Manual SSHD(8)
NAME
sshd - OpenSSH SSH daemon
~ (略) ~
DESCRIPTION
sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these
programs replace rlogin(1) and rsh(1), and provide secure encrypted com-
munications between two untrusted hosts over an insecure network.
sshd listens for connections from clients. It is normally started at
boot from /etc/rc. It forks a new daemon for each incoming connection.
The forked daemons handle key exchange, encryption, authentication, com-
mand execution, and data exchange.
sshd can be configured using command-line options or a configuration file
(by default sshd_config(5)); command-line options override values speci-
fied in the configuration file. sshd rereads its configuration file when
it receives a hangup signal, SIGHUP, by executing itself with the name
and options it was started with, e.g. /usr/sbin/sshd.
Select オブジェクトから SQL 文字列への変換
Zend_Db_Select オブジェクトに対応する SQL クエリ文字列にアクセスしたい場合は、 __toString() メソッドを使用します。
Example #31 __toString() メソッドの例
$select = $db->select() ->from('products'); $sql = $select->__toString(); echo "$sql\n"; // 出力は、次のような文字列になります // SELECT * FROM "products"