DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

SFTP remote readdir Permission denied error

May 18, 2020 DbAppWeb Admin

Problem

Getting below error after connecting to SFTP server:

# sftp sftp_user1@dbappweb.com 
sftp_user1@dbappweb.com's password: 
Connected to dbappweb.com. 
sftp> ls
remote readdir("/incoming"): Permission denied

 

Reason

I was getting the “Permission denied” error because SELinux was enabled on the SFTP servers and it was enforcing. The status of SELinux can be checked using getenfore command:

# getenforce
Enforcing

 

Solution

I have set up an SFTP server and created some SFTP users to access their home directories only using chroot. After configuring the setup below commands need to be run to resolve the above error.

# setsebool -P ssh_chroot_rw_homedirs on
# restorecon -R /home/sftp/sftp_user1

Where /home/sftp/sftp_user1 is the home directory of the SFTP user sftp_user1.

After executing the above command for SFTP user sftp_user1, the user is able to access files and folders under the home directory.

# sftp sftp_user1@dbappweb.com 
sftp_user1@dbappweb.com's password: 
Connected to dbappweb.com. 
sftp> ls
incoming

 

Related Posts

  • How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)

Last Updated: May 18, 2020

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Linux RedHat Linux SFTP SSH Sys Admin System Security

No Responses

  1. Pingback: How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH) - DbAppWeb.com

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com