• 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
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

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Join/Merge Multiple Log Files For Big Data Analysis

    Here Are The Ways To Join/Merge Multiple Log Files For Big Data Analysis, Store Them To OpenStack Based Cloud Storage And Delete Old Files.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Unix Shell or Shell

    Unix Shell or Shell refers to the traditional user interface under Unix or Unix-like computer operating systems. User can type a command type, which is executed by the computer.

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

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
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