• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Setup SFTP Without Shell Access For WordPress, Cloud Server

By Abhishek Ghosh June 20, 2017 7:28 am Updated on June 20, 2017

Setup SFTP Without Shell Access For WordPress, Cloud Server

Advertisement

Normally we have a common security setup for the servers which we described on our guide on basic server setup and ensuring security. Paid web hosting control panels like cPanel usually have either no shell but FTP or SFTP access or limited shell access. Often we need to host account on vps or cloud server where it is desired to have a setup sftp without shell access for WordPress Like cPanel. We are using Ubuntu 16.04 as server operating system and WordPress files as FTP content.

Of course we have softwares like vsftd and with Fail2Ban the security can be made more. But username of FTP and shell if set as different then it is actually safer for one server one IP one user/website too.

Setup SFTP Without Shell Access For WordPress, Cloud Server

 

Setup SFTP Without Shell Access For WordPress, Cloud Server

 

We are taking that WordPress is not installed yet. First, from shell we need to create a user, the name should be difficult to guess and thecustomizewindows is example here :

Advertisement

---

Vim
1
sudo adduser thecustomizewindows

You’ll prompted for password. Other details is optional, you can hit ENTER to leave those fields blank. Run these commands to check whether the outputs are meaningfully correct :

Vim
1
2
id thecustomizewindows
ls -lad /home/thecustomizewindows/

The target can be achieved in many ways but this is easy :

Vim
1
2
3
4
5
6
7
8
mkdir /home/thecustomizewindows/sites/public/
mkdir /home/thecustomizewindows/sites/public/html/
mkdir /home/thecustomizewindows/sites/logs
sudo chown root:root /home/thecustomizewindows/sites
sudo chmod 755 /home/thecustomizewindows/sites
sudo chmod 755 /home/thecustomizewindows/sites/logs
sudo chown thecustomizewindows /home/thecustomizewindows/sites/public/
sudo chown thecustomizewindows /home/thecustomizewindows/sites/logs

So, /home/thecustomizewindows/sites/public/ is the location where we will have the WordPress site as well as the user can have SFTP access.

We need some modification of /etc/ssh/sshd_config file :

Vim
1
nano /etc/ssh/sshd_config

Make sure the configuration looks like :

Vim
1
2
3
4
5
6
7
8
9
10
...
Match User sammyfiles
ForceCommand internal-sftp
PasswordAuthentication yes
ChrootDirectory /home/thecustomizewindows/sites
PermitTunnel no
AllowAgentForwarding no
AllowTcpForwarding no
X11Forwarding no
...

save the file. Run these commands :

Vim
1
2
3
/etc/init.d/sshd restart
sudo service ssh restart
exit

Test to SSH :

Vim
1
ssh thecustomizewindows@your.IP.address

You should see the error :

Vim
1
2
This service allows sftp connections only.
Connection to localhost closed.

 

Steps For Setup WordPress On Our SFTP Without Shell Access

 

Of course we need change in virtual host configuration (we are taking that Apache2 is running, normally we install Apache2 in this way) :

Vim
1
2
3
4
5
6
7
8
9
...
<VirtualHost *:80>
       ServerName thecustomizewindows.example.com
       ServerAdmin webmaster@example.com
       DocumentRoot /home/thecustomizewindows/sites/public/
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog /home/thecustomizewindows/sites/logs/access.log combined
...

Run :

Vim
1
2
apachectl -t
sudo systemctl restart apache2.service

Make sure that the file really can be created by Apache :

Vim
1
/home/thecustomizewindows/sites/logs/access.log

Now you can normally install WordPress as SFTP user in the way you want. If you do FTP via client like Filezilla, you can only edit files from :

Vim
1
/home/thecustomizewindows/sites/public/

Of course access log will be available :

Vim
1
/home/thecustomizewindows/sites/logs/access.log

Tagged With setup sftp in wordpress

This Article Has Been Shared 544 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Setup SFTP Without Shell Access For WordPress, Cloud Server

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

  • WordPress XML-RPC Attack & Fake PHP5-FPM Error

    WordPress XML-RPC Attack Can Bring DDoS Resulting in Random 502 PHP5-FPM Errors on Nginx Server or Can Make the Database Down. Here is Fix.

  • Cheap Cloud & Virtual Servers For Running Apache Big Data Tools

    Here Are Some Points For Selecting Correct Servers For Running Apache Big Data Tools. Of Course We Are Talking About So Called Low End Box.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023
  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Setup SFTP Without Shell Access For WordPress, Cloud Server," in The Customize Windows, June 20, 2017, February 1, 2023, https://thecustomizewindows.com/2017/06/setup-sftp-without-shell-access-wordpress-cloud-server/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT