26 Aug

Fixing File and Directory Permissions for cPanel Users with a Bash Script

Managing file and directory permissions on a cPanel server is crucial for both security and functionality. Incorrect permissions can expose sensitive data or cause website errors. This guide shows you how to use a Bash script to quickly fix permissions for cPanel users.

Why Are Permissions Important?

In Linux systems, permissions determine who can read, write, or execute files and directories. The most common permission settings are:

  • Directories: 755 – Owner has full control; others can read and execute.
  • Files: 644 – Owner can read and write; others can only read.

These settings protect your files while allowing websites to function correctly.

Bash Script to Fix Permissions

Here’s a simple Bash script to adjust permissions for a specific cPanel user:

#!/bin/bash
# Script to fix permissions for a cPanel user

if [ "$#" -lt "1" ]; then
echo "Must specify user"
exit
fi

USER=$@

for user in $USER; do
HOMEDIR=$(egrep "^${user}:" /etc/passwd | cut -d: -f6)

if [ ! -f /var/cpanel/users/$user ]; then
echo "$user user file missing, likely an invalid user"
elif [ "$HOMEDIR" == "" ]; then
echo "Couldn't determine home directory for $user"
else
echo "Setting ownership and permissions for user $user"
chown -R $user:$user $HOMEDIR
chmod 711 $HOMEDIR
chown $user:nobody $HOMEDIR/public_html $HOMEDIR/.htpasswds
chown $user:mail $HOMEDIR/etc $HOMEDIR/etc/*/shadow $HOMEDIR/etc/*/passwd

find $HOMEDIR -type f -exec chmod 644 {} \; -print
find $HOMEDIR -type d -exec chmod 755 {} \; -print
find $HOMEDIR -type d -name cgi-bin -exec chmod 755 {} \; -print
find $HOMEDIR -type f \( -name "*.pl" -o -name "*.perl" \) -exec chmod 755 {} \; -print
fi
done

chmod 750 $HOMEDIR/public_html

if [ -d "$HOMEDIR/.cagefs" ]; then
chmod 775 $HOMEDIR/.cagefs
chmod 700 $HOMEDIR/.cagefs/tmp
chmod 700 $HOMEDIR/.cagefs/var
chmod 777 $HOMEDIR/.cagefs/cache
chmod 777 $HOMEDIR/.cagefs/run
fi

How to Use the Script

  1. Save the Script: Save the code to a file named fixperms.sh.
  2. Make It Executable: Run chmod +x fixperms.sh to make the script executable.
  3. Run the Script: Execute the script by running bash fixperms.sh <username>, replacing <username> with the cPanel username.

Conclusion

This script provides a quick way to standardize file and directory permissions for cPanel users, enhancing security and functionality. Always test scripts in a safe environment before applying them to production servers.

By following these steps, you can ensure that your cPanel environment is secure and operating smoothly.

13 Aug

How to Install PPTP VPN on Linux

Setting up a PPTP VPN server on a Linux machine is a straightforward process. This guide will walk you through the steps required to get your VPN server up and running.

Step 1: Install PPTPD

PPTP depends on the PPP and PPTPD packages. To install them, run the following commands:

yum install pptpd

Or, download and install the PPTPD package using:

wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm
rpm -Uhv pptpd-1.4.0-1.el6.x86_64.rpm

Step 2: Configure PPTPD

After installation, you’ll need to configure the PPTPD server. Start by editing the IP settings in the /etc/pptpd.conf file:

nano /etc/pptpd.conf

Add or modify the following lines:

localip 192.168.0.1    # Server's primary IP
remoteip 192.168.0.100-200

Next, update the DNS settings in the /etc/ppp/options.pptpd file:

nano /etc/ppp/options.pptpd

Add the following lines:

ms-dns 8.8.8.8
ms-dns 8.8.4.4

Step 3: Create a VPN User

To allow access to the VPN server, you’ll need to create a user account. Add the user credentials in the /etc/ppp/chap-secrets file:

nano /etc/ppp/chap-secrets

Insert the following line:

username pptpd password *

Replace username and password with your desired credentials.

Step 4: Enable IP/Network Forwarding

IP forwarding is essential for routing packets between VPN clients and the internet. Enable IP forwarding by editing the /etc/sysctl.conf file:

nano /etc/sysctl.conf

Uncomment or add the following line:

net.ipv4.ip_forward = 1

To apply the changes, run:

sysctl -p

Step 5: Configure IPTables for NAT

NAT (Network Address Translation) allows VPN clients to access the internet through the server’s public IP. First, identify your network interface (e.g., eth0, ens33) by using the ifconfig command.

Assuming your network interface is eth0, add the following IPTables rules:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT

Save these rules to ensure they persist after a reboot.

Step 6: Start and Enable the PPTPD Service

Finally, start the PPTPD service and enable it to run at boot:

systemctl start pptpd
systemctl enable pptpd

Your PPTP VPN server is now set up and ready to use. You can connect to it using any PPTP VPN client with the user credentials created earlier.

23 May

Important Update: Google Workspace Pricing Adjustment Effective June 1, 2024

Thank you for your ongoing partnership with TetraHost for your Google Workspace services. We are writing to inform you about an upcoming adjustment to the pricing of our Google Workspace services, effective June 1, 2024.

This change is driven by two key factors: a recent pricing update from Google and the continuous upward trend in the dollar exchange rate. While we understand that any price increase can be concerning, we want to assure you that this adjustment is necessary to maintain the high-quality service you’ve come to expect from TetraHost.

Pricing Adjustment Details:

For Existing Users:

The new pricing will be reflected in your renewal invoice starting June 1, 2024.

For New Users:

Clients subscribing to our Google Workspace service after June 1, 2024, will be subject to the new pricing.

Despite these changes, our commitment to providing exceptional value and support remains unwavering. Google Workspace continues to offer innovative features and collaborative tools designed to help your business succeed.

If you have any questions or concerns about this pricing adjustment, please do not hesitate to contact our dedicated customer support team at support@tetrahostbd.com or +8801711825320. We are here to assist you with any inquiries.

We sincerely appreciate your understanding and continued trust in TetraHost as your Google Workspace service provider. We look forward to continuing to serve you with the highest level of service.

Thank you for your continued partnership.

22 Nov

Troubleshooting ‘WebSocket Handshake Failed’ Error in cPanel’s Terminal Feature

Encountering the “Error: The WebSocket handshake failed” message while using the Terminal feature in cPanel can be frustrating, especially if you’re accessing cPanel through a sub-domain like https://cpanel.yourdomain.com.

Why does this error happen?

When you try to open the Terminal in cPanel, it uses something called a “socket.” This socket needs to confirm where you’re connecting from. If it detects a proxy, it stops working.

How to solve it:

Mostly, this happens when user uses third party DNS server such as Cloudflare. Cloudflare’s way of hiding your real IP address causes this problem. To fix it, try accessing cPanel using a server IP address or the server’s hostname instead of the Cloudflare-protected one.

By doing this, you can bypass the error and use the Terminal feature in cPanel hassle-free.

Here’s what you can try to fix it:

1. Use these links to access cPanel >> Terminal:

– https://server-ip-ipaddress:2083
– https://server-hostname:2083

If these links don’t work, try these steps:

– Turn off any proxies or VPNs you might be using.
– Try different web browsers to see if that helps.

If you’re still experiencing issues with this problem, please reach out to our support team for assistance via https://www.tetrahostbd.com/contact.

21 Nov

Unveiling Black Friday Bonanza: Irresistible Offers Await You at TetraHost!

Greetings, esteemed TetraHost community,

As we step into the season of gratitude and cheer, it brings us immense pleasure to unveil something truly special for you – our exclusive Black Friday extravaganza!

At TetraHost, we believe in celebrating this occasion by sharing the joy with our cherished patrons like you. Brace yourself for these incredible Black Friday deals:

Shared Hosting: Elevate your web presence with a Free Domain accompanied by an astounding 40% Discount! Simply utilize the Coupon Code: BF2023 during checkout. Plus, revel in lifetime discounts that seamlessly apply to Shared Hosting offers in your cart.

Reseller Hosting: Have aspirations of running your own reseller business? Begin your journey with a generous 10% Discount, Two Months Free, and a complimentary Domain Name upon an annual purchase. Enter Coupon Code: 10OFF to embark on TetraHost’s reseller hosting plan.

Virtual Private Server (VPS): Seeking a robust VPS solution? Enjoy an exceptional 10% off on our enterprise-grade VPS Service. Explore a plethora of options encompassing Linux, Windows, and Custom OS Solutions using Coupon Code: VPSBF2023.

We’re here to support you!

In the event you need guidance on choosing the perfect plan, wish to delve deeper into our offerings, or encounter any hurdles while placing your order, our dedicated team stands ready to assist. Connect with us at sales [at] tetrahostbd.com or call us at +8801913377417 for prompt and personalized support.

Make this Black Friday an unforgettable experience!

18 Nov

Solving ‘421 Too Many Connections’ Error in FileZilla for Seamless FTP Transfers

FileZilla is a convenient tool for FTP file transfers in cPanel. However, encountering a ‘421 too many connections’ error can disrupt this process. To ensure smooth file transfers, let’s explore two methods to fix this issue.

Understanding the Error:
FileZilla throws this error when attempts exceed 8 connections from the same IP address without closing older ones. Incorrect settings might also trigger unsuccessful connection attempts.

Error Message:
“Response: 421 Too many connections (8) from this IP Error: Could not connect to the server.”

Method 1: Refresh Connections via cPanel

1. Log into your hosting account and access cPanel.
2. Look for “FTP Connections” under the “Files” section. If you can’t find it there, scroll down to locate it.

3. Open “FTP Connections” to see all active connections. Click “Reload” to refresh them.

Method 2: Increase FTP Connections from FileZilla

1. Open FileZilla and navigate to the File Manager option, which might vary based on your operating system. For instance, in iOS, you’ll find an icon, while Windows might display options like File, Edit, etc. Access the File Manager or Site Manager.

2. Click on “My Sites” from the left-sidebar and open the “Transfer Settings” tab.

If the settings area is accessible, select “Limit number of simultaneous connections,” and set the “Maximum number of connections” to more than 8. Click “Ok” to save the settings.

Please note: FileZilla doesn’t facilitate the disconnection of old connections; you’ll still need to use your cPanel account for that.

By following these steps, regardless of the presence of older connections with incorrect settings, you should be able to establish a successful connection between FileZilla and your hosting server.

These methods ensure a hassle-free experience with FileZilla for FTP transfers.

Explore our range of shared and reseller hosting plans!

17 Oct

Troubleshooting Network Issues Using MTR Reports

MTR, a network diagnostic tool, assesses the network connections between your physical location and your hosting server. It blends the capabilities of both ping and traceroute, enabling you to consistently monitor a remote server and observe how latency and performance change over time. To conduct an MTR test on Windows, you’ll need to install WinMTR, which can be obtained from this link.

Once it’s installed, launch WinMTR.

1. In the “Host” field, input the domain name or IP address you want to trace, and then click the “Start” button.
2. Allow it to run for at least 30 seconds, then click the “Stop” button.
3. Capture or export the results in either text or HTML format, and send them to your provider via email. This will help them to analyze the data(please include your public IP address as well).

16 Aug

Important: Google Workspace Service Price Adjustment Notification

We hope this email finds you well. We greatly value your continued partnership with TetraHost for your Google Workspace services. We are writing to inform you about an upcoming adjustment in the pricing of our Google Workspace service.

Effective August 16, 2023, there will be a price increase for our Google Workspace service. This decision has been necessitated by two factors: a pricing update by Google and the continuous upward trend in the dollar exchange rate. While we understand that any change in pricing can be a concern, we want to assure you that this adjustment is essential to maintain the high-quality service you’ve come to expect from TetraHost.

Here’s how the pricing adjustment will be applied:

  1. Existing Users: For our valued existing users, the new pricing will be implemented from your upcoming renewal invoice.
  2. New Users: New clients who subscribe to our Google Workspace service after 16, August 2023 will be subject to the new pricing.

We remain committed to providing you with exceptional value and support, even as external factors impact our pricing. Google Workspace continues to offer cutting-edge features and collaborative tools that empower your business to thrive.

If you have any questions or concerns regarding this price adjustment or its implications for your subscription, please do not hesitate to contact our dedicated customer support team at support@tetrahostbd.com or +8801913377417. We are here to address any inquiries you may have.

We sincerely appreciate your understanding and continued trust in TetraHost as your Google Workspace service provider. We look forward to continuing to serve you with the highest level of service.

Thank you for your continued partnership.

16 Aug

Important Update: .COM Domain Price Revision

We sincerely appreciate your continued partnership and the trust you have placed in our services. Your support has been instrumental in making us who we are today.

We are reaching out to inform you about an impending change that will affect your online presence. The .COM domain, which is an integral part of your web identity, is subject to a price revision by its registry, Verisign. Effective September 1, 2023, Verisign will be implementing a pricing adjustment for .COM domains. This change is in response to a variety of factors, including market dynamics and currency fluctuations, which have been particularly pronounced, given the recent increase in the dollar exchange rate in Bangladesh.

In light of these developments, we would like to provide you with the updated pricing details for .COM domains:

  • New Registrations and Transfer-Ins: 1400tk
  • Renewals: 1500tk

Please be aware that the aforementioned prices are exclusive of VAT and TAX. We understand the importance of budgeting and cost management for your online initiatives, and we are committed to maintaining transparency in our pricing structure.

We want to assure you that this decision was not taken lightly, and we remain dedicated to delivering the utmost value and service to you. As your trusted partner, we are committed to helping you navigate these changes seamlessly and ensuring that your online presence continues to flourish.

Should you have any questions or concerns about this pricing revision, or if there’s anything else we can assist you with, please do not hesitate to reach out to our customer support team. We are here to provide you with the guidance and support you need during this transition.

Thank you once again for choosing us as your online business partner. We are excited about the opportunities that lie ahead and are confident that together, we can overcome any challenges that come our way.

25 May

Introducing Nagad as a New Payment Option – Convenient and Secure!

We are excited to announce that we have expanded our payment options to provide you with even more convenience and flexibility. As part of this effort, we are now accepting payments through Nagad, a trusted Digital Financial Service offered by the Bangladesh Post Office.

We understand that seamless and secure transactions are of utmost importance to our valued clients, and we believe that Nagad meets these expectations perfectly. With Nagad, you can now make payments directly from your Nagad account using our Nagad Merchant Account. To initiate the payment process, simply follow the steps outlined below:

Log in to your Nagad account.
Navigate to the “Merchant Pay” option.
Enter our Merchant Number: 01841377417.
Ensure that the payment amount matches the total stated on the invoice. There is no need to include any additional payment charges.
Use the invoice number as a reference while sending the payment.

using NAGAD APP

using NAGAD USSD Code

By introducing Nagad as a payment method, we aim to simplify the payment process for you and provide a seamless experience. This secure platform offers various benefits, including real-time transaction notifications, instant payment confirmations, and a user-friendly interface. With Nagad, you can enjoy peace of mind knowing that your payments are being handled securely and efficiently.

Should you encounter any issues or have any questions regarding payments through Nagad, please don’t hesitate to reach out to our dedicated support team. We are here to assist you and ensure a smooth transition to this new payment method.

We value your business and continuously strive to enhance our services to meet your evolving needs. We sincerely hope that the introduction of Nagad as a payment option will bring added convenience to your experience with us. We appreciate your trust and look forward to serving you with the utmost dedication.

Thank you for choosing our services!