CentOS7 WinScp ordinary users to upload files without permission solve

CentOS7 WinScp ordinary users to upload files without permission solve

[View tutorial original]

Linux environment: CentOS 7.3
SFTP tool: WinSCP

Problem Description:
       Unable to login as root remotely, using a common user login without permission to upload files.

       When we use WinSCP to connect with Linux server via SFTP protocol, if ordinary users to log in, then the process of uploading files will be prompted permission denied, saying users without permission error return code is 3, the following is the problem Solution.

  1. Remote login Linux system, first enter the su command, then enter the ROOT administrator password Enter, and then enter the following command to perform a carriage returnfind / -name sftp-server -print
    Here Insert Picture Description

  2. [Setting user rights, access to SFTP binary file to the average user]
       After obtaining sftp-server file path, enter the following command to edit modify / etc / sudoers configuration file visudoto find the next statement in the text
    root ALL=(ALL) ALLby pressing the keyboard i, enable insert mode, ALL at the root ALL = (ALL) and press Enter to add the following sentence at the end in the underlying (dejan ordinary user name, into your own!)

    	dejan  ALL=NOPASSWD:/usr/libexec/openssh/sftp-server
    

Here Insert Picture Description

  1. After the modification, first press the keyboard ESC key, and then locate the following statement up:
    Defaults requiretty
    Press the keyboard i, enable insert mode, plus # sign in front Defaults requiretty, to comment out the statement
    #Defaults requiretty
    [PS: I did not find it there in CentOS7.3 Again, so skip this step]

  2. Finally, save and exit Edit, enter the command (note the two characters):x

  3. If you want to make mistakes again not want to save the new exit, typing the command (note the three characters) :q!

  4. Connection set winscp end, set the hostname, port number, user name, password after clicking "Advanced"
    Here Insert Picture Description

  5. SFTP settings
    Here Insert Picture Description

  6. Setting Shell
    Here Insert Picture Description

  7. Determined after landing can save, then upload the file

Reference links

https://jingyan.baidu.com/album/9c69d48f87ff2913c8024e69.html?picindex=1

Guess you like

Origin blog.csdn.net/cai454692590/article/details/90672357