LoginSignup
0
2

More than 3 years have passed since last update.

f12: textastic + xserver + sftp

Posted at

[ おまとめ ]

いまさらですが、
textastic で xserver への sftp (SSH) において、
private key を使用する方法でつまづいたので、メモです

ちなみに、関係ないですが、エディタのファイル管理について、
・Textastic は ローカルにダウンロードして
 編集が終わったらアップロードしてリモートと同期する方式
・GoCoEdit は サーバのファイルを直接編集する方式
だそうです

GoCoEdit は未購入で、最新がどうなっているのか
分かっておりませんが、オフラインでも使用するため、
ローカルで編集してアップロードの方式がお好みのため、
Textastic を使用しております


[ 1. キッチン ]

iphone se2 / ios 13:5.1
textastic 5.3.1

xserver x10

windows10 64bit pc
puttygen.exe


[ 2. 調理 ]

(1) 公開鍵、秘密鍵 の作成

xserver / マニュアル / SSH設定
https://www.xserver.ne.jp/manual/man_server_ssh.php

を参照に、

公開鍵(パスフレーズ)と、
秘密鍵 xxxx.key を

作成しておきます

(2) textastic の sftp 設定

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-01
01.JPG

地球儀マーク

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-02
02.JPG

プラスマーク

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-03
03.JPG

(S)FTP Connection

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-04
04.JPG

FTP (Unencrypted) をタップし、

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-05
05.JPG

SFTP (SSH Connection) に変更し、

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-06
06.JPG

以下を設定

Title: MyServer (適当な名前)
Protocol: SFTP (SSH Connection)

Host: svXXXX.xserver.jp
Port: 10022
User: USERNAME
Password: 公開鍵(パスフレーズ)
Path: /home/USERNAME/DOMAINNAME/public_html/
Connections: 3 (接続、リトライ数です)
Debug Log: お好みで、有効か無効

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-07
07.JPG

Public Key Auth. 有効
Private Key File: /ssh/id_rsa

※このデフォルトで表示される

/ssh/id_rsa

は、/ が、textastic のルートディレクトリで、
ルートに ssh というディレクトリを作成して、
private key file は、id_rsa という名前にしなさい
という意味です、試してませんが、
/aaa

/bbb/ccc
でも、できるかもしれません

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-08
08.JPG

一応、指定どおり、
秘密鍵 xxxx.key を id_rsa にリネームして、
ssh ディレクトリを作成して、格納しました

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-09
09a3.jpg

-> で、xxxx.key を使用して接続
-> 失敗。。

ファイルフォーマットが違います
と出ました

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-10
textastic のマニュアルを眺めてみます
https://www.textasticapp.com/v9/manual/remote_servers/sftp_ftps_ftp.html

09b3.jpg

Public Key Authentication

Note
Textastic supports RSA, DSA, ECDSA, and Ed25519 keys.

-> private key file は、RSA, DSA, ECDSA, and Ed25519 keys.のフォーマットが必要みたいです

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-11
09c3.jpg

Key File Format
If you instead have a key in PuTTY’s format (.ppk),
you can use PuTTYgen to convert it to OpenSSH/PEM format:

-> 以前に filezilla の SFTP 設定で、この PuTTY.ppk に、変換したことを思い出しました
それを使って試してみます

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
こちらの方のページに PuTTY.ppk 変換について詳しく載っております

エックスサーバー に FileZilla で SFTP 接続 を設定する方法
https://www.buzzclub.site/2018/05/11/archives112/amp/
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

秘密鍵 yyyy.ppk を id_rsa にリネームして、
ssh ディレクトリに、格納しました

-> 再度、yyyy.ppk を使用して接続
-> 同様エラーで失敗。。

再び、textastic のマニュアルを眺めてみます
https://www.textasticapp.com/v9/manual/remote_servers/sftp_ftps_ftp.html

Visit the PuTTY website and download puttygen.exe (on your PC).
Open it, and using the File menu, load your .ppk file
that you already use, and type in your passphrase.
Now go to the Conversions menu and export the key as an OpenSSH key.
You can now use the converted key with Textastic.

-> puttygen.exe を使って、.ppk ファイルをコンバートして使ってみてね
と書いてありますので、使ってみます

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-12
Download PuTTY: latest release (0.74)
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

10.jpg

puttygen.exe (a RSA and DSA key generation utility)
64-bit: puttygen.exe

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-13
11c.jpg

yyyy.ppk ファイルを Load します

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-14
12b.jpg

公開鍵(パスフレーズ) を入力します

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2-15
13c.jpg
14b.jpg

Conversions メニューから、Export OpenSSH key を
選択して、RSA コンバートします

秘密鍵 zzzz.ppk_to_openssh を id_rsa にリネームして、
ssh ディレクトリに、格納しました

-> 再々度、zzzz.ppk_to_openssh を使用して接続
-> 今度は、うまくいきました!

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""



0
2
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
2