Ubuntu 23.04 SSHサーバー(openssh-server)をインストールする

環境

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.04
Release: 23.04
Codename: lunar
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 23.04 Release: 23.04 Codename: lunar
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:        23.04
Codename:       lunar

操作方法

1.パッケージを更新する
$ sudo apt update

2.openssh-serverをインストールする
$ sudo apt install openssh-server

3.起動状態の確認
$ sudo systemctl status ssh

4.SSHサーバーを操作する上での基本的なコマンドについて紹介します。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
操作 コマンド
SSHサーバーの停止 $ sudo systemctl stop ssh
SSHサーバーの起動 $ sudo systemctl start ssh
SSHサーバーの再起動 $ sudo systemctl restart ssh
設定のリロード $ sudo systemctl reload ssh
自動起動の有効化 $ sudo systemctl enable ssh
自動起動の無効化 $ sudo systemctl disable ssh
操作 コマンド SSHサーバーの停止 $ sudo systemctl stop ssh SSHサーバーの起動 $ sudo systemctl start ssh SSHサーバーの再起動 $ sudo systemctl restart ssh 設定のリロード $ sudo systemctl reload ssh 自動起動の有効化 $ sudo systemctl enable ssh 自動起動の無効化 $ sudo systemctl disable ssh
操作	コマンド
SSHサーバーの停止	$ sudo systemctl stop ssh
SSHサーバーの起動	$ sudo systemctl start ssh
SSHサーバーの再起動	$ sudo systemctl restart ssh
設定のリロード	$ sudo systemctl reload ssh
自動起動の有効化	$ sudo systemctl enable ssh
自動起動の無効化	$ sudo systemctl disable ssh

 

Ubuntu 23.04

Posted by arkgame