Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

SFTP restricted user (Debian Jessie)

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
yuryn
Posts: 1
Joined: 2017-03-06 11:14

SFTP restricted user (Debian Jessie)

#1 Post by yuryn »

Hi,

I need to create a user who could upload files to a web root folder /var/www/mysite (Debian Jessie, Apache 2.4) via SFTP . I tried to accomplish this task in accordance with the Linode guide.

/etc/ssh/sshd_config file: Subsystem sftp internal-sftp
Match Group sftp_users ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp
Restart OpenSSH

$> sudo addgroup --system sftp_users
$> sudo adduser webboss
$> sudo usermod -G sftp_users webboss
$> sudo chown root:root /home/webboss
$> sudo chmod 755 /home/webboss
$> cd /home/webboss
$> sudo mkdir docs
$> sudo chown esljwebboss:sftp_users *


The Linode guide (like many others) ends as "Your users should now be able to log into their accounts via SFTP and transfer files to and from their assigned subdirectories."

But it never happened. Until I created manually a /home/webbos/.ssh folder and a authorized_keys file with my public key inside.

Is this step missed in the guide, or did I miss something?

Thank you
Last edited by yuryn on 2017-03-06 11:54, edited 1 time in total.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: SFTP restricted user (Debian Jessie)

#2 Post by dasein »

Since you are a very first time poster, you might want to remove the link to your ISP. In general, links to commercial sites are deeply frowned upon hereabouts.

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: SFTP restricted user (Debian Jessie)

#3 Post by reinob »

yuryn wrote: The Linode guide (like many others) ends as "Your users should now be able to log into their accounts via SFTP and transfer files to and from their assigned subdirectories."

But it never happened. Until I created manually a /home/webbos/.ssh folder and a authorized_keys file with my public key inside.

Is this step missed in the guide, or did I miss something?
I had a quick look at the guide and it seems to assume that the user already existed before, meaning that the authentication (password and/or key) was already set-up before restricting it to sftp.

Post Reply