0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

エックスサーバーにSSH接続【レンタルサーバー】

Posted at

XserverにSSH接続

ssh -p10022 xs123456@sv14460.xserver.jp

image.png

SSHキーの登録

SSHキーの生成

ssh-keygen
# すべてエンター

SSHキーのコピー

cat ~/.ssh/id_rsa.pub

コピーしたSSHキーをサーバーパネルで登録

image.png

改行区切りで複数のSSHキーを登録できます。

ONになっているかも確認しましょう
image.png

cronの設定 番外編

まず、SSH接続します

# cronの設定
[xs123456@sv14460 ~]$ crontab -e

# cronの設定の確認
[xs123456@sv14460 ~]$ crontab -l
* * * * * pwd >> pwd.log
* * * * * id >> id.log


[xs123456@sv14460 ~]$ cat /home/xs123456/pwd.log
/home/xs123456

[xs123456@sv14460 ~]$ cat /home/xs123456/id.log
uid=20001(xs123456) gid=1000(members) groups=1000(members),20001(xs123456)

/home/xs123456/pwd.log/home/xs123456/id.log が作成されます。

cronの実行ユーザはxs123456で、作業ディレクトリは/home/xs123456となります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?