winscp中使用sudo的方法

導讀 用截圖瞭解如何在 WinSCP 中使用 sudo。

首先你須要檢查你嘗試使用 WinSCP 鏈接的 sftp 服務器的二進制文件的位置。
你能夠使用如下命令檢查 SFTP 服務器二進制文件位置:html

[root@kerneltalks ~]# cat /etc/ssh/sshd_config |grep -i sftp-server
Subsystem sftp  /usr/libexec/openssh/sftp-server

你能夠看到 sftp 服務器的二進制文件位於 /usr/libexec/openssh/sftp-server。
打開 WinSCP 並單擊「高級」按鈕打開高級設置。
winscp中使用sudo的方法winscp中使用sudo的方法
它將打開以下高級設置窗口。在左側面板上選擇「Environment」下的 「SFTP」。你會在右側看到選項。linux

如今,使用命令 sudo su -c 在這裏添加 SFTP 服務器值,以下截圖所示:
winscp中使用sudo的方法winscp中使用sudo的方法
因此咱們在設置中添加了 sudo su -c /usr/libexec/openssh/sftp-server。單擊「Ok」並像日常同樣鏈接到服務器。服務器

鏈接以後,你將能夠從你之前須要 sudo 權限的目錄傳輸文件了。ssh

完成了!你已經使用 WinSCP 使用 sudo 登陸服務器了。server

via: https://kerneltalks.com/tools/how-to-use-sudo-access-in-winscp/htm

做者:kerneltalks 選題:lujun9972 譯者:geekpi 校對:wxyblog

本文由 LCTT 原創編譯,Linux中國 榮譽推出get

原文來自: https://www.linuxprobe.com/winscp-sudo.html編譯

相關文章
相關標籤/搜索