SSHログインでログイン失敗を確認する方法

CentOSでは、SSHログイン・コンソール操作に関するログは「/var/log/secure」に保存されています
Debian, Ubuntuでは、SSHログイン・コンソール操作に関するログは「/var/log/auth ...
ディレクトリ内のファイルをzipで圧縮する

ディレクトリ内のファイルをzipファイルに圧縮するには「zip」コマンドを圧縮できます
書式は「zip -r 」になります。「-r」でサブディレクトリを含めて圧縮できます
zip -r example_com.zi ...javaのバージョンを確認する方法

LinuxでJavaのバージョンを確認するには「java -version」のコマンドで確認できます。但し、Javaがインストールされている場合です
$ java -versionopenjdk version "11.0.17 ...Linuxで使用しているポートを確認する[Netstat]

Linuxで使用しているポートを確認する方法は、lsof、ss、netstat、nmap等ありますが、本記事では「netstat」を利用した方法を紹介します
「netstat -atun」とコマンドを打つと以下のようにLi ...
MySQLのデータベースの名前を変更する

データベースの名前を変更したい場合は、MySQLではリネームのコマンドがありません。
新しいDBを作成してdumpしたデータをインポートするか、RENAME TABLEコマンドを利用してリネームするしかないようです
サーバーをシャットダウン時に「A stop job is running for …」と表示されサーバーが停止しない

Zabbixを運用しているクラウドのサーバーで、仮想マシンを停止時に「A stop job is running for Zabbix Server」と表示され永遠と停止されなくなります。停止できなくなるので「強制的に停止する」のオプ ...
userdel でユーザー削除時にホームディレクトリも削除する

Linuxでユーザーを削除するときは、「userdel」のコマンドを削除しますがこのコマンドで何もオプションを使用しない場合は、ホームディレクトリやメールスプールのディレクトリが残ってしまいます
# testユーザーを作成します ...シェルスクリプトで「integer expression expected」のエラー

昔作ったシェルスクリプトで久しぶりに実行してみたら、下記のように「integer expression expected」とエラーが上がって処理ができていませんでした
sh test.sh: line 6: ; then ec ...自動起動しているサービスの確認

CentOS 6では自動起動を設定しているサービスの確認は、下記のように「chkconfig」でおこなえました
# CentOS 6$ chkconfig --list ...MariaDBで「ERROR 1040 (08004): Too many connections」のエラー

WEBサーバーが重くてアクセスできにくいと申告があったので、下記のようにWordpressのDBにログインしようと思ったら「ERROR 1040 (08004): ...
Let’s encrypt で別サーバーで稼働している証明書を取得

今回サーバー移設の話がありました。レンサバで運用していて別のクラウドに移設するとの事です。WebコンテンツやDBは移設側にコピーできたのですが、レンタルサ ...
実行中のコマンドをバックグランドで実行する

100G以上ある大きなデータベースをエクスポートしたら数時間かかりそうで、実行中のコマンドをバックグランドに回したくなりました。コマンド実行時に「nohup」を使えばいいですが忘れていました
実行途中でバックグランドで実行 ...
MySQL 外部から接続できるユーザーを追加する

開発環境のDBで外部から全許可したい要望があったので、全許可できるユーザーを追加してそのユーザーは外部接続できるようにします。
まずは、現状で接続できるユーザー等を確認します
mysql> select use ...CentOS Stream 9 でロケールを日本語に設定する

CentOS Stream 9 でロケールを日本語に設定する方法です。ロケールは言語と地域の情報です。
デフォルトでは、下記のように LANG=en_US.UTF-8 となり英語の設定となっています。ロケールの確認には「loc ...
ファイルの最終行が空行かどうかを確認する

シェルスクリプトで、「while read」を使ってファイルを読み込んで1行づつ処理する事があると思います。
先日、あるファイルを読み込んでする処理があり、そのファイルが一部訂正する必要がありWindowsで修正しました。その ...