为WinSCP添加root权限
at 2024.03.02 ca 群晖NAS by admin
sudoes文件
默认文件
## sudoers file. # Enable logging of a command's output. # Use sudoreplay to play back logged sessions. Defaults syslog=authpriv # Allow root to execute any command root ALL=(ALL) ALL # Allow members of group administrators to execute any command %administrators ALL=(ALL) ALL # Configure privilege of wheel group Cmnd_Alias SHELL = /bin/ash, /bin/sh, /bin/bash Cmnd_Alias SU = /usr/bin/su %wheel ALL=(ALL) NOPASSWD: ALL, !SHELL, !SU # Include user-defined sudoers #includedir /etc/sudoers.d
修改后文件
## sudoers file. # Enable logging of a command's output. # Use sudoreplay to play back logged sessions. Defaults syslog=authpriv # Allow root to execute any command root ALL=(ALL) ALL # Allow members of group administrators to execute any command %administrators ALL=NOPASSWD: ALL # Configure privilege of wheel group Cmnd_Alias SHELL = /bin/ash, /bin/sh, /bin/bash Cmnd_Alias SU = /usr/bin/su %wheel ALL=(ALL) NOPASSWD: ALL, !SHELL, !SU # Include user-defined sudoers #includedir /etc/sudoers.d
修改的地方 将 %administrators ALL=(ALL) ALL 修改为 %administrators ALL=NOPASSWD: ALL
群晖NAS
将修改后的sudoers文件上传到 /volume1/docker 目录
控制面板 - - 计划任务 - - 用户自定义脚本 - - 用户账户 root - - rm -rf /etc/sudoers 强制删除sudoers文件 cp -f /volume1/docker/sudoers /etc/sudoers 将/volume1/docker/目录中的sudoers 文件复制到 /etc/ 文件夹中
WinSCP软件
打开(点击) - - 主机名(输入) - - 用户名(输入) - - 密码(输入) - - 编辑(点击) - - 高级设置(点击) - - shell(点击) - - sudo su-(选择)- - 确定(点击)- - 保存(点击)
版权声明
本站所有资源均来自网络,本站只做收集汇总工作!