duコマンドでディレクトリ毎の容量を表示する

duコマンドでディレクトリごとに容量を表示するには、対象のパスが「/var/www/vhosts/」の場合では、
「du -sh/var/www/vhosts/*」、「du -h –max-depth=1/var/ ...
findコマンドを使って、パーミションを一括で変更する

前回の記事「所有者を指定してファイル・ディレクトリを探す方法」で、findを利用してファイル・ディレクトリの所有者を探す方法を紹介しています。今回は、findコマンドでパーミションを ...
所有者を指定してファイル・ディレクトリを探す方法

findコマンドで、ファイルやディレクトリの所有者を指定して、探す方法を紹介します。
findコマンドで所有者を指定するオプションは「-user」を使用して探したい ...
SSHで不正ログイン( failed login attempts since the last successful login.)

SSHでログインして「root」にスイッチすると下記のようにSSHログインで〇〇回失敗していると警告がありました
$ sudo su -Last failed login: Wed Sep 30 10:00:00 JST 201 ...SSDのディスクで「kernel: ata1.00: failed command」のエラー

SSDを使用しているサーバーで2~3日に数回ほど下記の「www01 kernel: ata1.00: failed command: WRITE FPDMA QUEUED」エラーが発生するようになりました。
Aug 31 07: ...Cookie の SameSite 属性、Secure属性を設定する

Chrome 80 よりSame-Site属性のデフォルト値が「None」から「Lax」に変更されます。他のサイト(クロスサイト)でcook ...
/var/log/messages で変更後のホスト名が反映されない場合の対処方法

ホスト名を変更後に「/var/log/messages」に出力されるホスト名は、変更前のホスト名がなっている場合の対処方法を紹介します
現在のホスト名が「www01」の場合で、ホスト名を「web01」に変更した場合に「/v ...
シェルスクリプトで小数点以下を四捨五入する方法

シェルスクリプトで小数点以下を四捨五入する方法ですが、awk コマンドを利用すればできます。
awkコマンドでは、「printf(“%d\n”,x)」とすれば整数として出力できるので、小数点以下を切 ...
historyコマンドの履歴を削除する方法

コマンドの履歴を表示する「history」コマンドがあります。コマンドで引数にパスワードを付きのコマンドを利用したり、間違った内容をペーストしたりして「history」の履歴したい場合あるかと思います。個 ...
シンボリックリンクの作成と削除【CentOS】

Linuxでは、シンボリックリンクを作成するには「ln」コマンドを使用します。「-s」のオプションでハードリンクの代わりにシンボリックリンクを作成するように指定します
書式: ln -s
PostgreSQLのバックアップとリストア(pg_dump・pg_restore)

PostgreSQLのデータベースをバックアップするには「pg_dump」を使用して、リストアする時は「pg_restore」を利用してバックアップ及びリストアします
pg_du ...Postfixメール送信できなくなった(RBL lookup error: Host or domain name not found)

外部からメールサーバーに接続してメールを送るPHPプログラムがあった、そのプログラムでメール送信ができなくなったとの連絡がありました。メールログを確認すると以下のメールログがありました
postfix/smtpd: warnin ...qmailでsubmission(587)を利用する

今は使用してる人は少ないかと思いますが、「qmail」を利用しているメールサーバーで25番ポートのアクセスが多くなり、「SYN flooding on port 25. Sending cookies」のエラーが多発するようになりまし ...
Let’s Encrypt証明書発行を「acme.sh」で発行する (ワイルドカード)

CentOS 6系のサーバーでPythonのバージョンが古く、最新のcertbot を使えなかったのでシェルスクリプトで動作する「acme.sh」でワイルドカード形式の無償SSL証明書を発行し ...
Let’s Encrypt証明書発行から削除する方法

発行したLet’s Encrypt証明書を削除するには、以下のディレクトリにあるファイルを削除すれば、証明書が削除することができます
/etc/letsencrypt/arch ...