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 3 years have passed since last update.

SFTPでClear Linuxに外部からセキュアに(?)アクセス

Posted at

やりたいこと

リモートから仕事をしていると、息抜きにリモートロケーション(別宅)からベース(本宅)に置いたClear Linuxにはいってごちゃごちゃいじりたいと思い、外部からSSHでファイル転送できるまでのいきさつを書きます。

参照リンク:
https://docs.01.org/clearlinux/latest/guides/network/openssh-server.html

前提条件

OpenSSHがインストールされていること

sudo swupd bundle-add openssh-server

参考にした文にはデフォルトのポートを変えましょう、と出ていますが、ポートはFirewallのポートフォワーディングでマッピングしているので今回はそのままにします。(Port=22)

sFTPをEnableする

SSHの設定ファイルに以下のステートメントを加えるだけ。ちなみにリモートデスクトップも使えるようにしたいのでそれも書き込んでいます。sFTPだけなら最初のsusbysytemだけでいいみたいです。

clear~ $ cat /etc/ssh/sshd_config 
subsystem sftp /usr/libexec/sftp-server
AllowTcpForwarding yes
X11UseLocalhost yes
X11DisplayOffset 10
X11Forwarding yes

肝心のFTPサーバ

SFTPでいいですね。Configも特に要らないし。

参照リンク:
https://clearlinux.org/software/bundle/lftp

clear~ $ sudo swupd bundle-add lftp
Loading required manifests...
Downloading packs for:
 - lftp
 [100%]
...

sftp -P ${port-at-your-fw} hoge@yourd-dns-domain.mydns.jp
Password: 
Connected to yourd-dns-domain.mydns.jp.
sftp> ls
Desktop      Documents    Downloads    Music        Pictures     Public       Templates    Videos        
sftp> 

MyDNSさんのダイナミックDNSのサービスのおかげでドメイン名でアクセス出来るのはらくですね。(セキュリティーには注意ですが)

以上

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?