sftp and WARN: / is group writable

sftp and WARN: / is group writable

After literally countless hours setting up a SFTP user one of my Ubuntu servers, and having error messages on SFTP login, I finally succeeded.

The issue that I’ve faced is that the SFTP user couldn’t login and was presented with the error message:

[code]Write failed: Broken pipe
Couldn’t read packet: Connection reset by peer[/code]

Looking at the /var/log/auth.log file revealed the following:

[code]fatal: bad ownership or modes for chroot directory component "/"[/code]

The permissions for the directory for this user was set correctly and ssh server was restarted, I’ve even restarted the whole server to no avail. However, and out out of pure luck, when I turned off UFW I saw an error message saying:

[code]WARN: / is group writable![/code]

Since chrooted SFTP is really really picky about permissions, I knew it had to do something with permissions. I then checked the permissions of the root directory with:

[code]ls -ld /[/code]

and sure enough it had the write for the group enabled. A quick:

[code]chmod g-w /[/code]

issues and sure enough also the SFTP user was able to sign in!

As always, the solution to the problem was simple.

Trusted by over 2,000 organizations with millions of emails

Helpmonks helps us answer customer emails at lighting speed
We couldn't do our job without Helpmonks!
Helpmonks, the best thing since sliced bread
Excellent option for collaborating email amongst your team
A good platform that is here to grow and help you grow
Helpmonks is a great tool that our company utilizes and depends on
Great shared inbox for the team
Fantastic email support service for any business
Easy to navigate and catalog data for specific users
Solid Helpdesk software w/ responsive customer support
A really good solution to manage customer support mailbox
Good support, useful features

One more thing...

Helpmonks gives you the ability tocollaborate as a groupin your shared mailbox, features aTeam To-Do App, powerfulCustomer Relationship Management (CRM)capabilities, a completeLive-Chat tool, a mighty Email Marketing Platform that includes sending ofemail campaignsandemail automation, collision detection, email tracking, reminders, mentions, custom fields, custom applications, customer satisfaction ratings, Single-Sign-On (SSO) & SAML authentication, Trello, Zapier, Slack, an API, and much more.

Check outthe complete feature listor sign up for afree 30-day shared inbox trial now