Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

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

Comments

No comments

Let's comment your feelings that are more than good

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details

Being held Article posting campaign

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?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address