Linux環境設定/SFTPの有効・無効化
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* SFTPを有効・無効化する方法 [#ua25304c]
SFTPを有効、無効にする方法(設定)を以下に記します。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* SFTPについて [#j09730b3]
SFTPとはSSHのサブシステムとして動作します。~
したがって、sshdが動いていないとSFTPも利用することができ...
ちなみにクライアントとしてsftpコマンドがあります。~
以下のコマンドでログインすることができます。
sftp [ユーザアカウント@]接続先サーバ
クライアントコマンドであるsftpの操作コマンドについては、m...
* SFTPの有効・無効手順と実行例 [#bc0c9a09]
上述した通り、SSHのサブシステムとして動作しているので、SS...
以下、CentOSでSFTPの有効・無効のテストを行いました。
** 設定ファイル /etc/ssh/sshd_config [#gf35874f]
SSHの設定ファイルであるsshd_configを編集します。~
管理者権限(rootなど)で編集してください。~
尚、ssh_configというファイルもあります。~
編集するファイルはssh''d''_configです。
- 編集前(SFTP動作中) - /etc/ssh/sshd_config
Subsystemにsftpがされているのがわかります。
<snip>
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
一般ユーザ(sakura)からsftpコマンドで接続してみます。
$ sftp sakura@localhost
Connecting to localhost...
The authenticity of host 'localhost (127.0.0.1)' can't b...
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list...
sakura@localhost's password:
sftp> bye
初めてのsshによる接続だったのでThe authenticity of host.....
- 編集後(SFTP停止) - /etc/ssh/sshd_config
以下の手順を管理者権限(rootなど)でSFTPを無効化しました。~
+ Subsystemの前に#を追記しコメントアウトしました。
# override default of no subsystems
#Subsystem sftp /usr/libexec/openssh/sftp-server
+ sshdの再起動
# /etc/init.d/sshd restart
Stopping sshd: ...
Starting sshd: ...
一般ユーザ(sakura)からsftpコマンドで接続してみます。
$ sftp sakura@localhost
Connecting to localhost...
sakura@localhost's password:
Request for subsystem 'sftp' failed on channel 0
Couldn't read packet: Connection reset by peer
接続できなくなりました。(SFTPの無効化)
以上、SFTPの有効、無効化方法でした。
* 関連資料 [#kc845ca3]
-[[Ubuntu DesktopにSSHサーバーをインストールする方法>Ubun...
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
終了行:
#navi(../)
* SFTPを有効・無効化する方法 [#ua25304c]
SFTPを有効、無効にする方法(設定)を以下に記します。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* SFTPについて [#j09730b3]
SFTPとはSSHのサブシステムとして動作します。~
したがって、sshdが動いていないとSFTPも利用することができ...
ちなみにクライアントとしてsftpコマンドがあります。~
以下のコマンドでログインすることができます。
sftp [ユーザアカウント@]接続先サーバ
クライアントコマンドであるsftpの操作コマンドについては、m...
* SFTPの有効・無効手順と実行例 [#bc0c9a09]
上述した通り、SSHのサブシステムとして動作しているので、SS...
以下、CentOSでSFTPの有効・無効のテストを行いました。
** 設定ファイル /etc/ssh/sshd_config [#gf35874f]
SSHの設定ファイルであるsshd_configを編集します。~
管理者権限(rootなど)で編集してください。~
尚、ssh_configというファイルもあります。~
編集するファイルはssh''d''_configです。
- 編集前(SFTP動作中) - /etc/ssh/sshd_config
Subsystemにsftpがされているのがわかります。
<snip>
# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
一般ユーザ(sakura)からsftpコマンドで接続してみます。
$ sftp sakura@localhost
Connecting to localhost...
The authenticity of host 'localhost (127.0.0.1)' can't b...
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list...
sakura@localhost's password:
sftp> bye
初めてのsshによる接続だったのでThe authenticity of host.....
- 編集後(SFTP停止) - /etc/ssh/sshd_config
以下の手順を管理者権限(rootなど)でSFTPを無効化しました。~
+ Subsystemの前に#を追記しコメントアウトしました。
# override default of no subsystems
#Subsystem sftp /usr/libexec/openssh/sftp-server
+ sshdの再起動
# /etc/init.d/sshd restart
Stopping sshd: ...
Starting sshd: ...
一般ユーザ(sakura)からsftpコマンドで接続してみます。
$ sftp sakura@localhost
Connecting to localhost...
sakura@localhost's password:
Request for subsystem 'sftp' failed on channel 0
Couldn't read packet: Connection reset by peer
接続できなくなりました。(SFTPの無効化)
以上、SFTPの有効、無効化方法でした。
* 関連資料 [#kc845ca3]
-[[Ubuntu DesktopにSSHサーバーをインストールする方法>Ubun...
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
ページ名: