Sending sms in linux

How can I send mobile text message from terminal?

After 30 minutes I did find the smartphone by texting it using the answer I posted below. It was hidden underneath 4″ high-from-floor furniture shelf in the living-room.

If I read this correctly, you are asking for the equivalent of the Find My Phone service that will ring your phone regardless of volume, vibrate mode, bluetooth headphone, etc connected that make the phone silent. I know that Google has the one for android that you can do, but I am not aware of command line form of it. If I can figure it out it is unlimited for use. Same thing for Apple.

this must be the worst case of upvoting a terrible question that i ever seen on sen! 🤣 just because you can send an SMS using such complex means that barely work in the USA, doesn’t mean you are doing it in the linux way at all. then again, i must be extra grumpy today for some reason. in any case, i do need a good solution for this question! one that only uses bash and a cellphone with linux, and no 3rd parties or internet. please let me know if you, dear kind reader, do find a solution before i come back here. cheers! 😘

3 Answers 3

SMS Texting from Terminal / Shell / Bash

For the following steps open a terminal prompt aka «Command Line Interface» or «CLI». In most Linux distributions do this using Ctrl + Alt + T

textbelt.com to send text from bash

I found a reddit article: Send an SMS Text Message from the Command Line with this Bash / Terminal command you can use:

curl -X POST https://textbelt.com/text \ --data-urlencode phone='7801234567' \ --data-urlencode message='Find Your Phone!' \ -d key=textbelt 

Replace 7801234567 with your phone number. If you are texting an international phone number (outside Canada / USA) follow these instructions.

Note: The software replaces «Find Your Phone!» with a message that you need to purchase a key to use a custom message. But the software still insists you must provide a message that gets overwritten.

Other reasons for sending SMS Text Message from Bash

Finding my smartphone was an unusual need to send an SMS text message from Bash. You might have a few people that should be texted when:

  • Disks are about to fail (or other hardware errors occurred)
  • Disk space utilization exceeds threshold, for example 90%
  • RAM is full and swap is being used heavily
  • Web server is experiencing external attacks
  • A user had too many invalid sign-ons and account is deactivated
  • A specific job has been run which effects key processes
  • A door badge reader monitors a certain door being unlocked
Читайте также:  Подключение linux к роутеру

textbelt.com is Free for one text per day

Only one free SMS message a day can be sent by a given sender. Here is an example of the first and second attempts on one day:

$ find-phone # bash script with above command $ find-phone

Note: You maybe able to reset your router’s IP address for more than one text per day but I haven’t tested this yet.

You can use prepaid unlimited texts. There are many SMS gateway services available. Pricing at above vendor link varies from $0.03 to $0.15 per text. This is for reference and not an endorsement nor recommendation. Please do your homework and search for reputable pay-for-service vendors at best prices.

Create Bash Script

You could create a bash script called sms containing:

#!/bin/bash curl -X POST https://textbelt.com/text --data-urlencode phone='$1' --data-urlencode message='$2' -d key=textbelt 
  • Send SMS message using sms 7801234567 «Hello World»
  • Thank you Fabby for testing this from the EU and confirming it works there.

Send Email to carrier of the smartphone with SMS Text Message

For the following all you need is a web browser like FireFox, Internet Explorer or Chrome. No need to dive into the «bowels of bash» or limit yourself to one free text per day.

Many carriers allow you to send SMS Text Message to a smartphone by addressing an email to phone_number@mobile_provider_name.com .

Phone Number look up to get carrier’s website address

To get the provider’s website address using the phone number go to: https://freecarrierlookup.com/. Imagine we entered the phone number: 7801234567 :

Fee Carrier Lookup.png

We are told the email address to use is 7801234567@pcs.rogers.com . Now send an email to this address and your phone will sound with a notification.

Of course if you have your smartphone configured to sound with a notification when email arrives you can simply email your phone in the first place!

CLI interface for sending email address

In Ask Ubuntu there are many questions and answers on how to send email using bash. I’m using ssmtp (Secure Simple Mail Transport Protocol) for my cron daily backups: Backup Linux configuration, scripts and documents to Gmail

Although this setup is for one user, you can create a file with multiple users to text messages to:

Name Email Address Tiny Tim 5551234567@att.com Mrs. Clause 5552223333@sprint.com Bad Elf 5551114444@telus.net 

Where mail.txt looks like this:

Cc: admin@our_company.com Subject: Nightly Database Update FAILED From: root@our_company.com Content-Type: text/html; charset="utf8"  Nightly database update failed at procedure: AP005.  

There are many ways of sending email from bash. This is just one example. The important thing is the email address contains the smartphone number followed by the smartphone provider’s web address

Источник

How to Send and Receive SMS Messages from Linux?

Short Message Service (SMS) is a traditional communication solution for GSM-enabled mobile phones. Sometimes, one may also need to send SMS messages from their Linux PC, and if you are one of those people, you have come to the right place. In this article, I’m going to provide you an easy solution on how you can set up SMS communication on your Linux system.

Читайте также:  Unzip all files in directory linux

KDE Connect

KDE Connect is an excellent app that basically tethers your Linux desktop to your Android phone with great ease. It is free to use and has extensive functionality. We will show you in this article how you can use KDE Connect to not only send and receive SMS messages from your desktop but also avail additional benefits KDE Connect has to offer.

Using KDE Connect, you can transfer data from your desktop to your Android and vice versa. You can share web pages, view phone notifications, respond to text messages, and even use your desktop through your phone. It is actually quite amazing how much this small app lets you achieve in terms of functionality.

Moreover, KDE Connect allows its users to benefit from predefined commands or make their own to further increase their control. On top of that, it is open-source, free, and useful. The installation process is quite easy as well, and it only takes a few minutes.

Now, let’s move on to the installation part.

Installing KDE Connect on Linux

On Ubuntu, KDE Connect is supported by its official repository, so you can get it with a short apt command. Before we install it though, it is a good idea to first update the apt cache of the system. This good habit prevents installation issues later on. So, hit CTRL + ALT + T on your keyboard to start Terminal and run this command:

Once this is done, run the command below to install KDE Connect:

It should take a few moments to install, and once that is done, we can move on to the next step.

Installing KDE Connect on Android

As I mentioned earlier, KDE Connect is free and open-source, so you will not need to pay for anything. It is available in Google’s Playstore, and you can get it within a few seconds just like how you download and install any other app. Simply search for it in the store and install it.

Configuring KDE Connect

Now, we are going to set up KDE Connect both on Linux and Android. KDE Connect pairs two devices if they are on the same network. So, make sure your phone and desktop share the same Wi-Fi connection. Next, open the application on both platforms. You can do it on Ubuntu by going to the “Activities” segment and searching for it. Start it on your phone as you do with any other app.

Once you have KDE Connect running on Linux, you should see something like this on your Android phone.

This is the Ubuntu system appearing available for connection. Tap it so you can pair the two.

Graphical user interface Description automatically generated with medium confidence

At the top of your desktop screen, you should receive a pairing request. It will look like the image below, click “Accept” to proceed.

Читайте также:  How to see used ports linux

And with that done, the two of your devices will now be paired. On the top-right of your Linux screen, you should see a small “KDE Connect” icon. Click it, and then select your android device from the drop-down menu.

Graphical user interface Description automatically generated

Now that you have opened KDE Connect Indicator, you should see a list of plugins you can select and change. Find an entry for SMS in this list and make sure that it is checked. This permits SMS messages from the desktop side.

Graphical user interface, text, application, chat or text message Description automatically generated

You need to do the same thing from your phone now. To allow KDE Connect to send SMS messages and make calls, tap the three dots next to the paired desktop’s name and go to “Plugin Settings”. You should see a screen similar to the image below:

Make sure the “Send SMS” option is toggled on. With that done, you are on your way to successfully use your Linux computer to send and receive SMS messages.

Sending and Receiving SMS Messages

Finally, we reach the step that you are here for. You will shortly see that the process is relatively simple and easy to follow. Usually, traditional methods to send SMS messages from Linux are long, arduous, and painful to follow. For instance, there is a method that includes using Gnokii (a program suite built for communication between phones and PCs) and it only supports Nokia phones in addition to being lengthy and difficult. Other methods require modem configuration, etc. Thankfully, we have KDE Connect to make our lives easier and this whole process ten times simpler. Now, without any further ado, let us send and receive SMS messages from Linux.

Click on the icon in the top-right of your screen again, and here, when you select your android device, click on the “SMS Messages” option.

Having done that, you should now see a screen where you can see and browse your phone’s SMS message directory. Here, you can read previously received messages, reply to them, and be notified when you get a new text. You can try out the sending and receiving SMS messages feature by getting one of your friends to send you a message or just send one to yourself. It should look something like this.

And similarly, you can write one back.

With that done, SMS messaging should be fully operational on your Linux system. It is important to note that it is not Linux that is really sending SMS messages, it only works to pass the message along to your phone, which actually sends it.

Conclusion

That should cover everything for this article. There are several more awesome features to explore in KDE Connect. You should check them out for yourself and see how you like them. Hopefully, this guide was helpful to you in learning how to send and receive SMS messages from Linux.

Источник

Оцените статью
Adblock
detector