3
7

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

WinSCPをroot権限で使用する

Last updated at Posted at 2019-11-05

前提

  • Debian10
  • WinSCP

やりたい事

  • 特定ユーザーでログインしてからroot権限で操作したい

設定

Debian10側

-- 特定ユーザーでSSHをrootで扱えるようにする
※まずはSSHで接続してから、su -でrootをとる

command
user@debian:~# su -
user@debian:~# (password)
loot@debian:~# visudo

GNU nanoで開かれた内容に、以下を追加してから更新して閉じる
※[user]の部分にWinSCPでログインするユーザー名を指定する

/etc/sudoers.tmp
[user] ALL=NOPASSWD: /usr/lib/openssh/sftp-server

WinSCP側

SFTP -> SFTPサーバーに

WinSCP_SFTPサーバー
sudo /usr/lib/openssh/sftp-server

winscp_01.png

接続

設定したユーザーで接続したら、root権限でコピーなどが行えます

3
7
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
3
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?