Configuring ssh and sftp (limited to a folder)

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
orelv
Posts: 1
Joined: 2013/08/29 13:25:23

Configuring ssh and sftp (limited to a folder)

Post by orelv » 2013/08/29 13:43:01

Hello all,

I would like to configure ssh and sftp on a linux server.
My question is:
- Is it possible to create a user that can ssh and sftp (with both or only sftp limited to a folder)?
or:
- Is it possible to create a user account with an access limited to a directory (in that case, i'm not talking about remote connection) ?

I tried to modify /etc/ssh/sshd_config:

[code]PermitRootLogin no

# override default of no subsystems
SubSystem sftp internal-sftp
Match User sftp_user
# The following two directives force sftp_user to become chrooted
# and only have sftp available. No other chroot setup is required.
ChrootDirectory /home/tftp_dir
ForceCommand internal-sftp
# For additional paranoia, disallow all types of port forwardings.
AllowTcpForwarding no
GatewayPorts no
X11Forwarding no[/code]

but for that user ssh is no possible.
I would like to have ssh and sftp... (with both or only sftp limited to a folder)

Thanks in advance,
Regards

HenrykD
Posts: 73
Joined: 2011/01/14 06:09:52
Location: Poland

Configuring ssh and sftp (limited to a folder)

Post by HenrykD » 2013/09/02 05:30:59

Change the configuration file by adding this line:

AllowUsers sftp_user

Post Reply

Return to “CentOS 5 - Server Support”