Create FTP access for Lightsail LAMP Stack

0

What is the best practice of creating an FTP account for another use, Rather than giving SFTP access on the default key? Say, a developer needs to login and TEST or Implement a sample code, I need to give them a FTP or Cpanel like access so he can access and check,

Jayanga
질문됨 6달 전640회 조회
1개 답변
0

Hello.

Is your question more about how to manage Linux OS than AWS?
What I often do is create a Linux user for each development member, create an SSH private key, and then set /etc/ssh/sshd_config so that SCP can only be entered in the necessary directories.

profile picture
전문가
답변함 6달 전
  • Can you tell me how to achieve above please,,I am new to these commands and AWS lightsail,

  • You can add Linux users by following the steps in the document below. https://repost.aws/knowledge-center/new-user-accounts-linux-instance

    sudo adduser new_user
    sudo su - new_user
    cd
    mkdir .ssh
    chmod 700 .ssh
    touch .ssh/authorized_keys
    chmod 600 .ssh/authorized_keys
    cat >> .ssh/authorized_keys
    

    The following command is a preparation to allow connection only to "/opt/new_user".

    sudo mkdir /opt/new_user
    sudo chown new_user:new_user /opt/new_user/
    sudo chmod 755 /opt/new_user/
    

    The following command creates a backup of "sshd_config" and opens the file.

    sudo cp -pi /etc/ssh/sshd_confg /etc/ssh/sshd_config.bk
    sudo vim /etc/ssh/sshd_config
    

    When you open "sshd_config", add the following settings to the last line.

    Subsystem sftp  internal-sftp
    Match User new_user
        ChrootDirectory /opt/new_user
        X11Forwarding no
        AllowTcpForwarding no
        PasswordAuthentication yes
        ForceCommand internal-sftp
    

    After saving the file, restart the SSH service with the following command.

    sudo systemctl restart sshd.service
    

    By following the steps above, you can create a user who can only connect to "/opt/new_user" via SFTP.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠