Trending February 2024 # How To Setup Sftp Chroot Jail On Linux – Google Cloud # Suggested March 2024 # Top 4 Popular

You are reading the article How To Setup Sftp Chroot Jail On Linux – Google Cloud updated in February 2024 on the website We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 How To Setup Sftp Chroot Jail On Linux – Google Cloud

How to Setup SFTP Chroot Jail on Linux with Google Cloud Platform. Ever wonder how to lock down a user to their own home directory on your Ubuntu or CentOS servers.

By default a SFTP user can access all the folders in your server including other user’s directory also. No one wants the users to navigate around the server and view other users files.

In this tutorial you are going to learn how to setup SFTP Jail environment and lock down a user to their home directory. We will also restrict the access to SSH and allow SFTP only. This guide works on all Linux based distributions.

Prerequisites Step 1: Create a new Chroot Group

Create a new group to add all the users to this chrooted group.

sudo groupadd


Step 2: Add Users to the Chroot Group

Now create a user and add the user to the jailgroup group.

sudo useradd -g


-s /bin/false -m -d /home/



-g jailgroup will add the user to the restricted group we created above.

-s /bin/false will restrict he SSH access for the user.

-d /home/username will create a directory for the user in the /home

if you want to add the user who exists already you can just add the user to the group and restrict shell access.

sudo usermod -g


-s /bin/false


Step 3: Setup password for the user

By default Google Cloud does not allows password based authentication. If you have allowed password auth to yes you can setup password for the user or you can setup SFTP to access your instance or server.

To setup password you can follow this.

sudo passwd


Step 4: Setup Correct Permissions

Important: The users home directory must be owned by the root user and must have the 755 permission to prevent the users to create additional directories in their own home directory.

sudo chown root: /home/


sudo chmod 755 /home/


Now you can create new directories inside the users home directory and setup full access to the respective users.

sudo mkdir /home/


/{public,logs} sudo chmod 755 /home/


/{public,logs} sudo chown







By default Apache or Nginx runs with the user www-data, as these directories are owned by the respective user you need to configure PHP-FPM pools to run as the user owning the files.

Step 5: Configure SSH

Open the SSH configuration file /etc/ssh/sshd_config

sudo nano /etc/ssh/sshd_config

Go to the bottom of the file by pressing ALT + / to find the line starting with Subsystem sftp /usr/lib/openssh/sftp-server

Replace it with the following.

Subsystem sftp internal-sftp

Finally to the bottom add these.

Match Group




ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no

Hit CTRL + X followed by Y and Enter to save and exit the file.

Now restart the SSH service to apply the changes.

sudo systemctl restart ssh

For CentOS or Fedora you can use the following command to restart the SSH service.

sudo systemctl restart sshd Step 6: Test the Setup

If you dont have password based authentication enabled you can setup SFTP to access your instance or server and test your configuration using FileZilla or WinSCP or CyberDuck.

You you have your passwords setup you can use these commands to check.

Open a SFTP connection to your server with the sftp command.





Enter the password you have setup before when prompted.

Run the pwd command, if the configuration is working fine you will get the output as /.


Remote working directory: /

Run the ls command to list all files and directories. You can see the directories we have created before.


public logs

Prepare yourself for a role working as an Information Technology Professional with Linux operating system


Now you have learned how to setup a chroot environment and restrict access to the user to their own home directory.

You're reading How To Setup Sftp Chroot Jail On Linux – Google Cloud

How To Setup A Google Ads Search Campaign

If you feel that you are wasting money with Google Ads, you can get more effective results by setting up a Google Ads Search Campaign the right way!

There are some common mistakes that marketers usually make while setting up their search campaigns in Google Ads.

Let’s dive in!

Not Setting up Conversion Tracking

The first classic mistake that people make is they don’t set up conversion tracking. 

Google Ads conversion tracking measures the success of your ad campaigns by tracking the conversion behavior of your audience. 

This is your way of telling Google what your goals are! 

For example, if you’re an eCommerce store, a conversion would be somebody who ultimately purchased your product or if you are a local business, it might be somebody filling in a contact form. 

First, you need to set up Google Ads conversion tracking before you start creating any campaigns. Conversion tracking will help you know if you’re getting returns on the money you have invested in Google Ads search campaigns.

There are multiple methods to track conversions in Google Ads. You can either use the built-in Google Ads Conversion Tracking method, or you could import your existing goals and eCommerce conversions into Google Ads from Google Analytics. 

If you’re not sure that you’ve set up conversion tracking, you can check it under the Conversions menu of Google Ads. To access it, navigate to Tools & Settings → Measurement → Conversions.

Next, we need to select the goal of a successful campaign. 

For this example, let’s try the Create a campaign without a goal’s guidance. This gives you all the available settings to set up a campaign, thus providing more flexibility in defining your goals. 

Let’s select a campaign type. There are many campaign types that you can select from. 

Let’s give a relevant campaign name and move forward in our search campaign setup. 

Search Network + Display Network

The next step in our search campaign setup brings us to a second common mistake.

Google by default keeps the Search Network and Display Network options checked. 

It is a good idea to keep the Display Network option on. But, it is not recommended to use the Search Network option. 

It will expand the menu to give you more options for your search campaign setup.

Ad Schedule

A mistake that marketers, especially local businesses, make is to ignore this setting.

On the contrary, if you’re selling an online course, you don’t need to have an ad schedule. 

Thus, depending on your type of business, you should consider whether to add an ad schedule or not.

Location Targeting Setup

Another common mistake is that we don’t input our location targeting properly.  It is necessary,  especially for local or small businesses. 

In this case of promoting an online course, we would create different campaigns for different countries. Let’s try to apply some location targeting in our Ad Search Campaign.

Be aware that All countries and territories are selected by default. It’s a classic mistake to avoid this default setting that Google has kept for us.

Let’s say we want to target the United States. We can choose a country to target from Enter another location. 

If we hover over the location options, there is another little setting called Target which is part of the location targeting. The default setting is for People in, regularly in, and, or who’ve shown interest in your target locations. 

This default setting means that the Ad would be shown to somebody who has shown interest in the US (because we’ve set our location target audience as the US). 

If somebody who’s in Europe has shown interest in things in America or the country in general, then the ad will be displayed to them too.

It helps to keep a  tight location target setting, so only the people in that area are targeted. Then, choose the middle option Presence: People in or regularly in your target locations on your Target setting.

If you’re a local business, you don’t want to target a whole country, but just the people in your area. We can take it a bit more granular, and go to Advanced Search and go ahead for Radius targeting. 

You’ll see it shows a 20-mile radius there, so you can do Radius targeting easily.

Choosing a kilometer radius makes it tighter for more impact

You can see it’s a much smaller circle, implying the ad is specific to that area only.

You can also exclude a country. So, let’s pretend we want to exclude Australia, we can add an extra layer of the filter.

Maximize conversions bidding

Another default setting by Google that we don’t pay attention to is the Maximize conversions bid strategy for your Ads.

If you are starting a new search campaign with a new account, we recommend you choose the select a bid strategy directly option.

Once you have some data, then you can do the automated bid strategies. But initially, you want to do Manual CPC. 

Another sly setting is the Help increase conversions with Enhanced CPC. Here Google is asking if they have permission to bid a little bit more when you can get a conversion.

Now, let’s proceed to explore other fatal mistakes we can avoid.

Keyword theme Ad groups

One of the most important things to do while creating an Ad group is to make the ad target the audience by using specific keywords.

Here, we create an Ad group name called Google. Set the default bid, in this instance, 50 cents. You can always change this later on.

We are going to add some keywords. A mistake that many people make unconsciously is that they don’t create keyword-themed Ad groups.  

It’s erroneous to add all the keywords in one Ad group. Sometimes one might add all the keywords in the same group, related or not, hoping for a far reach. This usually doesn’t work very well. There is a way you can avoid this!

You need to make keyword-themed Ad groups. You can proceed to create one Ad group per keyword.  Go ahead and put your keywords in the dialog box.

For instance, we’ll do a phrase match and say create Google retargeting in inverted commas. 

💡 Top Tip: Adding syntax is a  great way to get your campaign up and running efficiently.

If you put a keyword without any syntax, it’s called a Broad match. If you add inverted commas to your keyword, it is a Phrase match. Having square brackets around the keyword gives an Exact match.

Google’s algorithm will help fetch results to the searcher when they type in a word or a phrase. It then becomes necessary that you should ensure that you have a phrase match as your setting, if not an exact match

On the ad group, you see these keywords are very related to each other. There are slight variations, but it’s all about Google remarketing or retargeting Google or retargeting on Google.

Using a Phrase match allows for additional terms before and after it. So, we don’t have to think of every possible combination. We can be a bit flexible with that. 

You can avoid this error by creating keyword-themed Ad Groups and making sure the keywords are closely related to each other.

If you want to add to keywords, go ahead while making a new AdGroup for the cohort of keywords you’ll be using.

You can focus your ad on Facebook consumers by creating a Facebook retargeting ad. Finally, polish the ad created by designing your Facebook-centric ad group. 

Let’s Save and Continue.

Writing the Ad

This is where we’re going to need a final URL. Go to your website, copy and paste the URL on the Final URL section because that’s where you want to send the traffic to.

When you paste the final URL, notice, that it’s changed the display path to chúng tôi and here you can put in whatever words you want. 

This URL can be up to 15 characters long and it’s useful to optimize the search campaign. Let’s do it in lowercase.  We can say ‘retargeting challene‘, because it’s a 14-day retargeting challenge. 

Even though this URL chúng tôi does not exist, it’s a way of having more keywords in the ad. It displays the same way in the preview.

Don’t worry if the URL you’ve submitted is not live on your website; it’s a good way to get some keywords in the ad group.

After you input the URL, start creating the headlines. You can put up to 15 different headlines of which Google will choose three different headlines randomly. 

You can also pin a headline as well; this helps in making sure that the chosen headline will always show at that particular position.

All right, so let’s put in some headlines. Make sure they are short and direct. You can notice that Google tries to suggest a headline based on the Ad you’ve created.

We are keeping the Join The 14-Day Challenge Now. You can notice that the Preview shows the headline at a particular spot. You can pin it and can choose where the headline should be displayed.

In this instance, we’ve chosen position 1, which means it will only show in position one. Thus, this headline will always show in position 1 while headlines 2 and 3, will rotate through different options.

In considering the keywords chosen to create Google retargeting, let’s say create Google Retargeting Ads. This may get disapproved because Google is a trademarked term, but it may slip under the radar.

We’ve added other headlines such as Online Video Tutorials and we notice it shows up on the preview. 

If you’ve used up all available characters for a headline, fret not. Just keep adding headlines and Google can work an algorithm to make your ad work.

Next, we will write our description of the Ad with up to 90 characters. Google provides us with four spaces to write in our descriptions and then chooses two of these four for us randomly.

You can choose to pin one of these, similar to our headlines. Google shows two descriptions in an automated manner.

Another benefit of having more than one ad per ad group is that Google figures which ad works better for the audience and keeps that ad running more often. In case your Ad #1 doesn’t work its magic, you always have Ad #2 or #3 to count on.

If it says that no traffic is expected, don’t worry about it. They’re trying to get us to choose more keywords, which is something we want to avoid.

I’m just going to hit Publish. Let it run for 48 hours and see how it goes. 

After publishing the campaign, the webpage shows you an overview of the ad campaign you created.

BONUS: Negative Keywords

This is the bonus mistake! Negative keywords will tell Google when somebody types a particular word, and we do not want the ad to show.

In this instance, a classic negative keyword would be ‘free’. Somebody who wants free information cannot access it because we’re selling this information. 

Another one would be, ‘what is retargeting?‘ –  we don’t want that either. We want somebody who knows what retargeting is. We just want them to learn how to do it.

‘Definition’ is another word we want to avoid. This could be somebody who’s just been researching retargeting.

Thus, whether a word or a phrase, if you believe it’s going to display your ad, you can prevent the display to unwanted traffic by using Negative Keywords.

Often, people have no negative keywords. You can start a practice of keyword lists. This is one central location to look after the negative keywords that you can then apply to multiple campaigns.

If you want to add some more keywords, you can just easily go over the keyword suggestions and add them. Make sure to put them in double quotes to ensure a phrased match instead of a broad match.

You can also go over to the Search Keywords and find your keywords for the ad group. 

You may add, remove or alter the keywords from the list. Heading over to the plus sign on the top left corner to add words, you’ll be taken to the list where you can input the phrases. On the right, you can also find a list of suggested words.

If you choose to add keywords, either by typing or from the list, remember to use the double quotes to ensure it follows a phrase match.

Once all the additions are done, you can save it and you’ll have a preview of the keywords that are in use/active for your ad group.

In conclusion, these are the 8 fatal mistakes one can make while creating a new ad campaign.

FAQ Should I keep the Search Network and Display Network options checked in my search campaign?

By default, Google Ads keeps both the Search Network and Display Network options checked. While it’s a good idea to keep the Display Network option on, it is not recommended to use the Search Network option for a search campaign.

How can I set an ad schedule for my search campaign? What are keyword-themed ad groups, and why are they important? Summary

Setting up conversion tracking helps you know whether the Ad is profitable for you. A display or a search network option would show your Ads everywhere – appropriate and inappropriate – leading to unwanted traffic. You’d want to turn off the Search Network and Display Network settings.

Location targeting is important to ensure you’ve targeted the right audience geographically.

Minimize the bidding by choosing manual bidding strategies and keep Keyword-themed Ad Groups in your campaign. 

If you’re a retailer, make sure to check out these 5 tips for optimizing Google shopping campaigns.

How To Add Swap Space On Centos 7 – Google Cloud

How to Add Swap Space on CentOS 7 on Google Cloud. Swap Space is a space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.

Swap space can help machines with a small amount of RAM. In case you choose a VM instance with 600 MB RAM, then your memory will get exhausted and you will get cannot allocate memory.

This guide provides the steps required to add swap space on CentOS 7.

Not using CentOS 7? Choose a different OS:


A running Compute Engine, see Setting up Compute Engine Instance with CentOS 7.

Check Swap Space

Check whether your CentOS server already has a swap space available. More often virtual machines don’t have a swap space enabled by default. Check swap space with the following command.

sudo swapon --show

If you don’t get any output, then your server don’t have any swap space. It’s time to add swap memory.

01. Creating a Swap File

Now you can create a swap file to add 1 GB (1G) space. You can also increase the amount of space you need.

sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048572 02. Set up Swap File Permissions

Now you have a swap file of correct size and can be enabled as swap space.

Proceed by setting up correct permissions.

sudo chmod 600 /swapfile 03. Set up a Swap Space

You can now mark the file as swap space with the mkswap command.

sudo mkswap /swapfile

You will receive the output similar to this.

04. Enable Swap Space

Enable the swap space and allow the system to utilise the space.

sudo swapon /swapfile

Verify that the swap is available by typing:

sudo swapon --show

You can check the output of the free utility again.

free -h 05. Making the Swap File Permanent

Install nano editor.

sudo yum install nano -y

Now swap space is only created for the current session. If you reboot the server the current changes will be gone. So you can make this setting permanent by adding the swap file to our /etc/fstab file.

sudo nano /etc/fstab

Add the following at the end of the file.

/swapfile swap swap defaults 0 0 Configure Swappiness Value

The swappiness parameter allow to configure how often your system swaps data out of RAM to the swap space.

This value will be between 0 to 100 in percentage. The values close to zero, the kernel will not swap data to the disk unless absolutely necessary. The higher the value that are closer to 100 will try to put more data into swap in an effort to keep more RAM space free.

So, telling the system not to rely on the swap much will generally make your system faster.

You can see the current swappiness value by typing:

cat /proc/sys/vm/swappiness

Now set the value to 10 with the following command.

sudo sysctl vm.swappiness=


You can make this value permanent by adding the line to your /etc/sysctl.conf file.

At the bottom, add the following line.


Hit Ctrl+X followed by Y and Enter to save and close the file.

Removing Swap Space

Finally, delete the swap file.

sudo rm /swapfile Conclusion

Now you have learned how to create a swap file, activate, configure swap space and remove the swap space on your CentOS 7 server in Google Cloud.

3 Ways To Setup Parental Control In Google Chrome – Webnots

Access to the Internet has become extremely common and mainstream. Today, the majority of the children have access to the Internet due children. Content that is not suitable for children are available freely on the Internet. Moreover, children tend to search the Internet rigorously because adolescence is the age of curiosity.

It turns out to be the responsibility of parents to keep a check on their children’s online activities. Parents should be aware of what their children are browsing on the Internet and guide them. In the past, Google Chrome had a dedicated option to setup a supervised account for child. However, this feature is not available now and you can follow some indirect ways.

3 Ways to Setup Parental Control in Google Chrome

Here are the 3 ways for setting up parental control on Google Chrome when you share the same device with your child.

Enable safe browsing

Create child profile

Chrome parental control extension

If your kid has separate device then we recommend you to setup control on device level. Learn more on setting parental control on Windows 10, macOS and iOS.

1. Safe Browsing

browsing. This feature can help in creating a safer browsing environment to protect from malicious websites.

You can enable safe browsing by going to “chrome://settings”.

Scroll down “Safe Browsing” under “Privacy and security” section.   

Remember, safe browsing will not stop sites that your kid opens willingly thus optimum control is not possible. You can try to use below explained methods to have more control.

2. Create Child Profile

You can tweak Chrome’s settings to setup enhanced parental control. The best way is to create a separate user account for your child and sync it to your email account. In this way, you will always be aware of your child’s activities on the Internet and use for guidance. Here is how you can do it:

bar and choose “Manage people” option.

Add New Person in Chrome

A new window will open for the account. Go to “Settings” and enable sync as explained above. Now, link your Gmail account to the profile.

You can monitor your child’s complete browsing activities on other data by using the linked Gmail account. Creating a profile and linking to your Gmail account will even work when your kid has separate device. However, your kid can disable the sync feature from settings.

3. Extensions

Using extensions is the best method to setup parental control. Extensions have efficient and a high number of features to help parents in the supervision of their children. There are numerous extensions available on Chrome Web Store. Try the following extensions to setup parental control:

3.1. WebFilter Free

WebFilter Chrome Extension

You can set up a password for websites under the general settings.

Control filter has the option to block websites and even redirect to some other websites. This feature can certainly be helpful for parents to stop distraction for their children.

Moreover, profanity filter helps to block any website with the specific words in its address. Some words are already available, but more can be added depending on the requirement.

WebFilter Extension Options

3.2. Web Nanny

There is a chance that you allow a website to your children, but it has irrelevant words. For example, your children are allowed to use Facebook, but you want to avoid them seeing inappropriate words. For this purpose, you can make a list of words you want to filter and replace them with proper words. This will help kids not to get distracted with the words.

You can use Web Nanny to clean a whole web page make it suitable for your children.


Enter the word that you want to filter, add the word definitions”.


Parental control is an extremely important duty of parents. Chrome settings and extensions are both great to achieve certain level of control on your kid’s activities. However, your kid can easily disable them. Setting up a profile will help better to get all history of your kid’s browsing. Even your kid disable the sync, it needs your Gmail password for enabling the sync again. Also you can find from history if no data is recorded.

How To Install Linux Apps On Your Chromebook

Eric Zeman / Android Authority

Thanks to Linux support on Chromebooks, the Play Store isn’t the only place you can use to download apps. Many Chrome OS devices can run Linux apps, which makes them all that more valuable.

Installing a Linux app isn’t as simple as installing an Android app, but the process isn’t complicated once you get the hang of it. The good news is that when done correctly, you’ll feel like a computer whiz since there’s a bit of code involved.

Open the Settings app.

In the left navigation pane, select the About Chrome OS option. 

Check your Chrome OS version in the right pane, under Google Chrome OS.

Wait for the update to download and complete, and restart the Chromebook when prompted.

Enable Linux on Chromebook

Eric Zeman / Android Authority

Now that you’ve figured out that your Chromebook supports Linux apps, the next step is to enable Linux on your machine. It’s easy to do and won’t take a lot of time overall, although this depends on how fast your internet speed is and the power of your Chromebook.

Open the Settings on your Chromebook.

Once the download completes, a terminal window will open. You can use this window to download Linux apps, which we’ll discuss in the next section.

Read next: The best Chromebook deals you can get right now

How to download Linux apps on Chromebooks

Eric Zeman / Android Authority

Here’s the part you’ve been waiting for. But before we get into exactly how to download Linux apps on Chromebooks, there’s one more thing to do. To make sure everything runs smoothly, you have to update your packages by entering the command below into the terminal window. Hit Enter after you type/paste it in.

sudo apt-get update && sudo apt-get upgrade -y

Palash Volvoikar / Android Authority

Once that’s done, you can start downloading Linux apps on your device. There are two ways to go about this.

Installing Linux apps via Terminal

To do so, you have to use the command sudo apt-get install app name -y, in which you change the “app name” part with the actual name of the app. For example, if you want to download the popular image editor called Gimp, here are the steps you’d need:

Open the Terminal app

Enter the following command and hit enter:sudo apt-get install gimp -y. Many text lines will appear in the Terminal as the download and installation progress.

Palash Volvoikar / Android Authority

When the installation is finished, the Terminal will be idle, letting you type in commands again. You can then search for the installed app in the Chromebook’s search menu to open it.

See also: Set up VPN on a Chromebook

Installing Linux apps using the .deb file

This is a bit simpler. You can download the .deb Linux installer files directly from the internet for some apps, like Minecraft.

Transmission: This is a free Torrent client that allows you to download and upload files easily. Install it withsudo apt-get install transmission-qt -y

FileZilla: If you want to move files from your device to a remote server, an app like FileZilla makes the process faster. Install it withsudo apt-get install filezilla -y

Evolution: If you want to use a desktop email client instead of a web-based one, the Evolution Linux app is for you. Install it withsudo apt-get install evolution -y


Yes, most modern Chromebooks can run Linux apps. Your device must be updated to Chrome OS 69 or higher.

In order to install Linux apps on a Chromebook, you first need to enable the Linux subsystem. Then, either download an app package or use the apt-get command to install Linux apps as described in this article.

How To Setup Sendmail In Ubuntu

When it comes to sending email using Linux system, there are a few options to choose from. However, Sendmail is popular choices, and for good reason. Sendmail is efficient and reliable mail transfer agent (MTA) that handle large volume of emails.

In this article, we will show you step-by-step how to set up Sendmail on your Ubuntu system.

Before we start installation process, let’s talk to understand how Sendmail works. Sendmail works by accepting email messages from local or remote mail clients, then relaying them to destination mail servers. This messages can delivered to other machines on the local network or to external addresses on Internet. Sendmail uses Simple Mail Transfer Protocol (SMTP) to communicate with any mail servers or clients.

Installing Sendmail on Ubuntu

The first step in setting up Sendmail on your Ubuntu system is to install it. To do so, open a terminal and enter following command −

sudo apt-get update sudo apt-get install sendmail

This will download and install Sendmail package on your Ubuntu system.

Configuring Sendmail

Once Sendmail is installed, you need to configure it to work with your system. The main configuration file for Sendmail is located at chúng tôi However, you should not edit this file directly. Instead, you should use chúng tôi file, which is a macro configuration file that is used to generate chúng tôi file.

To edit chúng tôi file, open a terminal and enter following command −

sudo nano /etc/mail/

This will open chúng tôi file in Nano editor. In this file, you can set a variety of options for Sendmail, such as hostname, domain name, and mail relay settings. Here are a few examples of common settings −

define(`_CLASS_A_NET', `')dnl define(`_CLASS_B_NET', `')dnl define(`_CLASS_C_NET', `')dnl define(`_MAX_MESSAGE_SIZE',`10000000')dnl define(`_QUEUE_DELIVERY', `30m')dnl

These settings define IP address ranges that are allowed to relay email through your system, the maximum message size that can be sent, and maximum time that an email can be in queue before it is delivered.

Once you have made your changes to chúng tôi file, you need to generate chúng tôi file. To do this, enter following command in terminal −

This will generate chúng tôi file based on settings in chúng tôi file.

Starting Sendmail

After you have installed and configured Sendmail, you need to start Sendmail service. To do this, enter following command in terminal −

sudo service sendmail start

This will start Sendmail service and enable it to send and receive emails.

Testing Sendmail

To test if Sendmail is working properly, you can send a test email from command line. To do this, enter following command −

Troubleshooting Sendmail

If you encounter any issues with Sendmail, there are a few things you can check. First, make sure that Sendmail service is running by entering following command in terminal −

sudo service sendmail status

This will show you the status of Sendmail service and whether it is running or not. If it is not running, you can start it by entering following command −

sudo service sendmail start

If Sendmail service is running but you are still having issues, you can check the logs for any error messages. The Sendmail logs are located in chúng tôi file. You can view logs by entering following command in terminal −

sudo less /var/log/mail.log

This will open log file in less text editor. You can use arrow keys to scroll through logs and look for any error messages.

Additional Configuration Options

In addition to basic configuration options we covered earlier, there are many other options you can configure in chúng tôi file. Here are a few examples −

Relaying options − You can configure Sendmail to relay emails to specific domains or IP addresses, or to require authentication for relaying. This is useful if you want to limit who can use your Sendmail server to send emails. For example, you can add following line to chúng tôi file to allow relaying only for a specific domain −

FEATURE(`relay_hosts_only')dnl FEATURE(`access_db')dnl

Virtual domains − You can configure Sendmail to handle email for multiple virtual domains, each with its own set of users and aliases. This is useful if you are hosting multiple domains on a single server. For example, you can add following lines to chúng tôi file to set up a virtual domain −

FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable')dnl VIRTUSER_DOMAIN_FILE(`/etc/mail/virtusertable')dnl

Anti-spam measures − You can configure Sendmail to implement various anti-spam measures, such as filtering out emails with suspicious content or rejecting emails from blacklisted IP addresses. For example, you can add following lines to chúng tôi file to enable spam filtering −

FEATURE(`dnsbl', `')dnl FEATURE(`blacklist_recipients')dnl FEATURE(`badmx', `')dnl FEATURE(`accept_unresolvable_domains')dnl

By configuring these and other options in chúng tôi file, you can customize Sendmail to meet your specific needs.

Using Sendmail with Web Applications

If you are running a web application on your Ubuntu system that needs to send emails, you can use Sendmail as mail transport agent. Most web applications, such as WordPress or Drupal, have an option to configure mail settings. To use Sendmail, you simply need to specify the path to Sendmail executable in application’s mail settings.

By configuring your web application to use Sendmail, you can ensure that emails sent from your application are delivered reliably and efficiently.


In this article, we have provided you with a step-by-step guide on how to set up Sendmail on your Ubuntu system. We have covered installation process, how to configure Sendmail using chúng tôi file, how to start Sendmail service, and how to test and troubleshoot Sendmail. By following these steps, you can set up a reliable and efficient mail transfer agent on your Ubuntu system.

Update the detailed information about How To Setup Sftp Chroot Jail On Linux – Google Cloud on the website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!