サーバー外からアクセス接続
Rustadminを使用します。
DL先 ⇒ https://www.rustadmin.com/


RustAdminRelease.zip がダウンロード出来るので、任意の箇所に配置して、解凍してください。
RustAdmin.exe からアプリを起動します。

Server
| IP | サーバーのIPアドレスを指定 | 
| Server Port | Rustサーバーのポート番号。ex)28015 | 
| Rcon Port | Rconサーバーのポート番号。ex)28016 | 
| Password | rconサーバーのパスワードを設定。 | 
Steam API Key
HereからSteamにログインしていただくと必要な文字列を取得できますので、それを指定します。
上記設定後、下部にあるSaveから設定を保存(設定ファイルはなんでもよいです。)して頂き、左上のServerから、connectで接続が可能です。
サーバー内からアクセスする場合
Rcon client(rust-server-cli-rcon) の導入
# root へ移動
cd /root
# gitHubからソースをコピーします。
git clone https://github.com/kirbo/rust-server-cli-rcon.git
# コピーしたフォルダに移動
cd rust-server-cli-rcon
# 実行必要なパッケージ管理ソフトをインストール
apt-get install npm -y
# 実行に必要なライブラリをインストール
npm i websocket
# サンプルから設定ファイルを作成
cp sample.config.js config.js導入したclientソフトで Rust server に接続する為に、config.jsを編集します。
# vim コマンドより編集します。
vim config.js※webminを導入していれば、webminから編集して頂いても構いません。
config.js編集例
var config = {
  // name of this server block, used when using "server" argument
  localhost: {
    // configurations for server
    server: {
      // hostname or ip address
      address: 'localhost'
    },
    // configurations for rcon
    rcon: {
      // rcon port   --- 1
      port: '28016',
      // rcon password --- 2
      password: 'rconPass' 
    },
    autoCommands: [
      'say I\'m watching you'
    ],
    macros: {
    }
  },
};
module.exports = config;1 と 2 は環境に合わせて変更してください。
1 は Rconのポートになります。当サイトと同じ設定であれば、変更の必要御座いません。
2 は Rconへの接続する為のパスワードです。必ず変更して使用してください。
rcon client 起動
# 常時動かす為、別セッションを作成。名称は rcon 固定
screen -S rcon 
# 移動する
cd /root/rust-server-cli-rcon
# 起動する
node index.js
# ctrl + a , ctrl + d で元のセッションに戻る補足:rust-server-cli-rconはサーバー外からのアクセスも可能ですが、今回はサーバー内からのアクセス用として紹介させて頂きました。
では今日は、この辺で。
