Home Blog Page 34

How to Change SSH Listening Port on Ubuntu 24.04

0
How to Change SSH Listening Port on Ubuntu 24.04

Secure Shell or SSH is a network protocol that allows users to access servers remotely. This protocol also encrypts communication between servers to make it even more secure. Unfortunately, using standard Transmission Control Protocol (TCP) port 22 for SSH may be risky as it is vulnerable to various cyber attacks, especially brute-force attacks. Brute-force attacks are methods hackers use to gain access to encrypted confidential data. So, it’s best to change the default SSH port because this is a method to protect your SSH server. This article will teach you how to change SSH listening port on Ubuntu 24.04.

Prerequisites

An Ubuntu 24.04 VPS
SSH root access or user with sudo privileges

Conventions
# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user
Step 1. Login to the server
First, log in to your Ubuntu 24.04 server through SSH as the root user:
ssh root@IP_Address -p Port_number
You will need to replace ‘IP_Address‘ and ‘Port_number‘ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the system user with sudo privileges.
You can check whether you have the proper Ubuntu version installed on your server with the following command:
# lsb_release -a
You should get this output:
No LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu Noble NumbatRelease: 24.04Codename: noble
Step 2. Modify Firewall
This is the most important thing you need to do to change the SSH port on your Ubuntu server. Failing to do this will cost you a lot. You will be locked out of your system and unable to connect to it through SSH. Let’s first open the firewall for the port we are going to use.
If you use UFW (Uncomplicated Firewall), you can run this command below to open the port.
$ sudo ufw allow 2022/tcp comment ‘Allow SSH’
Or, if you are using iptables, you can execute this command instead.
$ sudo iptables -I INPUT -p tcp –dport 2022 -j ACCEPT
Make sure to use -I option to insert the rule on top of the list, and not -A option as this will place it on the bottom.
To save the new firewall rule, run this command:
$ sudo iptables-save > /etc/iptables/rules.v4
The command above will permanently save iptables firewall rules; the newly added rules will not be lost after you reboot your server.
Step 3. Change SSH Port
By default, SSH is listening on port 22. Your web hosting company may change your SSH port already, but you can change it to your desired port number. Let’s change the SSH port now.
$ sudo nano /etc/ssh/sshd_config
In this editor, find this line:
#Port 22
Uncomment it and replace 22 with 2022 or another number you want to be the new port.
Port 2022
Save the file, then exit the editor.
Please note if you already see this line
Port 22
Replace the number with the one you want to set as the new SSH port, then save the changes.
We need to restart the SSH service every time we change the /etc/ssh/sshd_config file.
$ sudo systemctl restart sshd
Congratulations! You have successfully changed the SSH listening port on Ubuntu 24.04.
If you liked this post on how to change SSH listening port on Ubuntu 24.04, please share it with your friends or leave a comment in the comments section.

AngryOxide — Easiest Way to Crack WiFi

0
AngryOxide -- Easiest Way to Crack WiFi

Warning:- This article is for research and educational purposes only. we are not responsible for anything you do or damage you cause from this article. We strongly advise to use against networks that you have permission or you have owned. For demonstration we are going to use our own network.Previously we have discussed about various WiFi penetration testing methods. Now, in this ultimate guide, we are going to discuss the easiest tool to test the security of a WiFi network using our Kali Linux system. Before starting this article we need to know that our normal computer or laptop’s WiFi usually not capable to crack WiFi networks. They normally don’t support monitor mode and packet injection. We need a capable WiFi adapter to do so. We have a list of capable WiFi adapter for monitor mode and packet injection.Let’s start, We are going to use a tool named “AngryOxide”. AngryOxide is a command line based tool written on Rust. As of now, it is not included with Kali Linux, so we need to install it from its GitHub repository.First, we start by installing Cargo on our Kali Linux system, as AngryOxide requires Cargo to run. Cargo is Rust’s build system and package manager. We can easily install it via using following simple command on our updated Kali Linux Terminal:sudo apt install cargo -yThis can take some time to install it depending on our internet speed and system configuration. In the following screenshot we can see the process.Now we are going to clone AngryOxide’s repository on our Kali Linux system by using following command.git clone https://github.com/Ragnt/AngryOxideAfter the cloning process is complete, we can navigate to the directory and view the files using the cd AngryOxide && ls command [Learn how to use Linux Terminal commands and bash scripting]. We can see the output of above commands from the following screenshot:Now we can compile it by using following command:make We can see the process of above command in the following screenshot:It may take some time depending on our system performance and internet speed. After finishing this we are gonna install this by using following command.sudo make installThe following screenshot shows the installation process.Now we can run this tool from anywhere on our computer. Suppose we need output on our Desktop then we just need to open our Terminal on our Desktop location. To do that we need to run following command:cd ~/DesktopNow we can easily run this tool. Let first we run it check the help options of this AngryOxide tool by using following command:angryoxide -hIn the following screenshot we can see the help options (menu) of AngryOxide tool.We are going to use these options to crack (better read security test) to any Wireless Network near by. Before that let we understand the working by using the options we got. In following list we are going to break down these options.Interface (-i, –interface): This is like choosing which WiFi card or adapter we want to use for testing.Channel (-c, –channel): We can think of WiFi channels like different radio stations. This option lets you choose specific channels to scan. If you don’t specify any, it will automatically scan commonly used channels 1, 6, and 11.Band (-b, –band): WiFi can operate on different frequency bands like 2.4GHz or 5GHz. This option lets you specify which band or frequency range to scan.Output Filename (-o, –output): This is where you specify the name of the file where the results of the test will be saved.Target Entry (-t, –target-entry): Here, we can specify a particular WiFi network (identified by MAC address or SSID) that we want to target for testing. If we don’t specify any, AngryOxide will test all networks it finds.Whitelist Entry (-w, –whitelist-entry): This is for specifying networks that we don’t want to attack. It’s like commanding AngryOxide, “Leave these networks alone.”Attack Rate (-r, –rate): Adjusts how aggressively the tool attacks networks.Combine (–combine): Combines output files into one for easier analysis.No active (–noactive): Disable activated Monitor mode of WiFi adapter.Autohunt (–autohunt): Automatically scans and focuses on channels where targets are found.Auto exit (–autoexit): Tells the tool to stop automatically once it has gathered all the needed data.No transmit (–notransmit): Makes the tool passive, meaning it observes without sending any data.No deauth (–nodeauth): Disables sending deauthentication frames, which are sometimes used in attacks.No tar (–notar): Prevents the tool from packaging the output files into a tar file.Disable mouse (–disablemouse): Turns off mouse capture, useful for headless operation (no graphical interface).Dwell Time (–dwell): Adjusts the time spent on each channel during scanning.First we can check network interfaces we are using on our system by using following command:ip aIn the following screenshot, we can see the network interfaces on our Kali Linux system.MAC address is hidden due to security & privacyIn the above screenshot we can see that our computer have only a wlan0 wireless network interface. We are using Kali Linux on our Desktop PC and that is an external WiFi card Alfa AWUS036NEH, if we were using a laptop then we might get two wireless network one for inbuilt wireless card another for external wireless card. in that case we have wlan0 and wlan1 as our network interface.Now we run AngryOxide tool to set our interface (wlan0) without making any noise on surrounding networks with no deauth and no transmit options. Here we requires root permissions, so our command will be as following.sudo angryoxide -i wlan0In the following screenshot we can see that our AngryOxide is running with a very beautiful command line interface and discovered some wireless networks. Here we also can see various options regarding discovered networks. Here we can use our keyboard for navigating things like q to quit, a/d to change tabs, space for pause, w/s to scrool, k for keybinds.We have hidden MAC addresses to maintain our privacy.Here for an example we have choose a WiFi network named Zero (SSID is the name of the WiFi Network). To select it we need to press down arrow key ⬇. Then we need to press 🇹 button on our keyboard to start attack on it. As we can see in the following screenshot.We can also see that we have captured 4-Way Handshake. 4-Way Handshake is capturing 4 messages (EAPOL Messages). Basically in normal language to understand this attack process we think like AngryOxide send de-authentication packets to target network (lots of packets on a network) which creates a traffic jam and all connected devices are disconnected due to overload then those connected devices or clients automatically try to connect to the network and send request to connect. Here is the catch in that request it send password also for validation. Password in the sense hash of the password. We capture the request using various applications just we are doing using AngryOxide. This capture process called handshake capturing.If we press 🇩 on our keyboard two times and go to the “Handshake” tab then we can clearly see that AngryOxide have captured handshakes successfully. Which shown in the following screenshot.Now our work is done. We can quit this by pressing 🇶 button on our keyboard.Then AngryOxide will ask for confirming the exit. Here we press 🇾 button to confirm our exit. We had run AngryOxide on our Desktop so after exit we can see a ZIP file on our Desktop. As we can see in the following screenshot.Now we can easily extract this ZIP file by right click and choosing “Extract Here” option.It will create a directory (Folder for Windows users) on our Desktop, inside that directory we can see some files.YOO! Handshake file is captured. Now what? It’s time to crack down this hash into plain text password. To do this we are going to use HashCat tool. Previously we have discussed about Hashcat.Sometimes we got the handshake (cap/pcap/pcapng) file then we need to convert it to put it on Hashcat for cracking Paswword. But AngryOxide already providing us the Hashcat format (filename.hc22000 format) which saves our some time. Lets crack this using Hashcat.We need to open a terminal window and run following command:hashcat <full-path-of-hashfile> <full-path-of-wordlist>In our case the command will be as followinghashcat /home/kali/Desktop/oxide-2024-05-01_21-14-38/Zero.hc22000 /usr/share/seclists/Passwords/WiFi-WPA/probable-v2-wpa-top447.txtHere we are using a passwordlist or wordlist which contains top 447 common passwords for WiFi cracking. We can download these kind of wordlists from internet (here we have used seclists, which can be installed on Kali Linux by sudo apt install seclists command).Hashcat is trying to crack the passwordIf the password isn’t common, then we might not find it. In that case, we need to run a dictionary attack. Which may took several years to crack a tough password depending on our System password (GPU’s are useful in this case).We intentionally put an easy password for our WiFi to demonstrate this tutorial. But with a large wordlist the chance of cracking the hash increased.In the following screenshot we can see that password for SSID named Zero is cracked.This is how we can easily capture WiFi handshake files using AngryOxide and crack WiFi password using Hashcat on Kali Linux system.Note:- This article is intended solely for educational and research purposes. We hereby absolve ourselves of any responsibility for the consequences of actions taken as a result of the information provided herein. Proceed with caution and understand that unauthorized use of the techniques described within may result in severe legal repercussions. We vehemently advise against employing these methods on networks without explicit permission from the network owner or administrator. For the purpose of demonstration, we will be conducting our experiments exclusively on our own network.Love our article? Make sure to follow us on Twitter and GitHub, we post article updates there. To join our KaliLinuxIn family, join our Telegram Group & Whatsapp Channel. We are striving to build a community for Linux and cybersecurity. For anything we always happy to help everyone on the comment section. As we know our comment section is always open to everyone. We read each and every comment and we always reply.

Further Your Education with Courses & Certifications

0
Further Your Education with Courses & Certifications




SAVE UP TO 50% TODAY

*Offer ends May 21, 2024

Learn More at Linux Foundation Training







Previous articleSave BIG on Earth Day Deals with Sitewide Savings!Next articleTake the Cloud Native Security Survey

Unlock Your Digital Content Management System Using DeDRM

0
dedrm

dedrm

What is DeDRM?

So what exactly is DeDRM? It is short for “De-Digital Rights Management,” and refers to the process of removing digital rights management (DRM) protection from electronic files. DRM is a set of access control technologies used by publishers and copyright holders to restrict the use and distribution of digital content, such as e-books, music, and videos.

Why Use DeDRM?

There are several reasons why individuals might choose to use DeDRM tools:

Content Portability: To access purchased content on different devices or platforms.

Backup Creation: To create personal backups of legally acquired content.

Format Conversion: To convert content into formats compatible with specific devices or software.

Accessibility: To make content accessible for individuals with disabilities using specialized software.

Preservation: To ensure long-term access to purchased content, even if the original platform becomes obsolete.

How DeDRM Works

DeDRM tools typically work by:

Identifying the DRM scheme used on the file.

Decrypting the protected content using known methods or user-provided keys.

Removing DRM-related code or metadata from the file.

Saving the content in an unprotected format.

The specific process can vary depending on the scheme and the tool being used.

Legal and Ethical Considerations

The use of DeDRM tools exists in a legal gray area and raises several ethical questions:

Copyright Laws: In many jurisdictions, circumventing DRM is illegal, even for personal use.

Fair Use: Some argue that DeDRM for personal use falls under fair use doctrine.

Consumer Rights: DeDRM advocates argue for the right to use purchased content without restrictions.

Piracy Concerns: Publishers worry that DeDRM tools facilitate illegal sharing of copyrighted material.

It’s crucial to understand the legal implications in your jurisdiction before using DeDRM tools.

Popular Tools in De-Digital Rights Management

While we can’t provide direct links or instructions for using these tools, some widely known solutions include:

Calibre DeDRM Plugin

Epubor Ultimate

Requiem (for older iTunes content)

Kindle DRM Removal

Adobe Digital Editions DRM Removal

Note that the availability and effectiveness of these tools may change over time as DRM technologies evolve and continuously updated.

Alternatives to DeDRM

Instead of using DeDRM tools, consider these alternatives:

DRM-free Stores: Purchase content from retailers that offer DRM-free options.

Subscription Services: Use services that provide access to a wide range of content without DRM restrictions.

Open Source Content: Utilize open-source or Creative Commons licensed materials.

Library Services: Many libraries offer e-book lending with more flexible DRM schemes.

The Future of DRM and DeDRM

The landscape of digital rights management is continually evolving:

Blockchain DRM: Some companies are exploring blockchain technology for more flexible and user-friendly DRM solutions.

Watermarking: Digital watermarking is emerging as a less restrictive alternative to traditional DRM.

User-Centric DRM: There’s a growing push for DRM systems that balance copyright protection with user rights and convenience.

Legal Challenges: Ongoing legal battles and policy discussions may reshape the future of DRM and the legality of using such tools.

By understanding the complexities surrounding DeDRM, users can make informed decisions about managing their digital content while respecting copyright laws and ethical considerations. As the digital landscape continues to evolve, staying informed about DRM technologies and alternatives will be crucial for both content creators and consumers.

Related Articles

Calibre DRM Removal Plugins / NoDRM Fork

Similar Articles from Unixmen

TUXEDO Computers Releases InfinityBook Pro 14 G… » Linux Magazine

0
NVIDIA Released Driver for Upcoming NVIDIA 560... » Linux Magazine

If you’re looking for an ultra-portable Linux laptop, TUXEDO Computers has just what you’re looking for in the new InfinityBook Pro 14. You can purchase the new laptop with either an Intel Core Ultra 7 155H or an AMD Ryzen 7 8845HS CPU.The chassis is 311 X 17 X 220 mm and weighs only 1.5 kg. The display is 2880 X 1800 3K at 400 nits, 120 or 60 Hz refresh rates, 1500:1 contrast, and 100% sRGB. You’ll find an 80 Wh battery that delivers up to 9 hours of runtime and up to 8 TB SSD and 96 GB or DDR5-5600 RAM. You can power up to 3 external screens, charge via USB-C, and enjoy HDMI 2.1 and 5 USB ports.The AMD Ryzen 7 CPU includes 8 cores, 16 threads, and uses 54 watts of power. The Intel option includes 16 cores and 22 threads and uses 60 watts of power.As for graphics, the AMD system includes an AMD Radeon 780M with 12 GPU cores at 2700 MHz, and the Intel system uses Intel Arc at 2.25 GHz with 8 Xe graphics cores.Both systems use Intel Wi-Fi 6E AX211 with 802.11 ac/a/b/g/n/ax DualBand 2.4/5/6 GHz wireless and Bluetooth version 5.3.
You can configure and pre-order an AMD unit (starting at 1.032,77 EUR) or an Intel unit (starting at 1.125,21 EUR).   

   

We Asked 10 Linux Questions to ChatGPT and We Got Amazing Answers

0
We Asked 10 Linux Questions to ChatGPT and We Got Amazing Answers

What is ChatGPT

If you are very busy and still did not hear about this internet buzz or you see it but did not actually know what it then we are here to tell you.ChatGPT is a language model developed by OpenAI, it is one of the many AI chatbots of its kind, there are other AI models such as GPT-2 (a predecessor of ChatGPT) developed by OpenAI and other companies like Google, Microsoft, Amazon, and IBM have also developed similar models. Whenever you chat or mail to google or Microsoft every time the chatbot replies to your general queries, only in case of escalation humans are involved.

The inspiration behind the creation of ChatGPT and other AI models like it is to create a machine that can understand and generate human-like text. These models are based on a neural network architecture called the transformer, which has shown to be very effective at natural language processing tasks such as language translation, text summarization, and question answering.

The idea behind creating such models is to make the computer understand human language more efficiently so that it can be used in various industries like customer service, content creation, and more. These models are also being used to improve the accuracy and efficiency of machine learning models in a wide range of applications such as speech recognition, natural language understanding, and others.

Additionally, OpenAI’s goal is to advance AI in a way that is safe for humanity and to provide the most powerful AI technologies to those who will use them to benefit humanity. OpenAI aims to make this available to everyone so that the benefits of AI can be widely distributed.

Who Owns OpenAI?

Elon Musk, Sam Altman,Wojciech Zaremba, Ilya Sutskever,and , Greg Brockman founded OPENAI in 2015 . ELON musk stepped out in 2018 and the current CEO is Sam Altman. The most important event is that Microsoft invested 1 Billion dollars in OpenAI, Maybe in the future, you can see OpenAI features in your Windows Office applications

You may be Interested : Most Important 22 Linux Commands

We have asked 10 Linux questions to ChatGPT, and let’s see how amazing it’s answered it. Did ChatGPT able to clear the Linux System Admin interview?

Create a User and the password expire in 60 days.

ChatGPT has done good work and is able to give the correct answer to this basic question. So one point to ChatGPT.

How to delete User with home directory?

ChatGPT again did good work it will help you delete the home directory of a user with the user account in Linux. For this question, you don’t need to go to StackOverflow. One point to this AI chatbot.

How to Troubleshoot SSH issues?

Ohh here we are quite disappointed with ChatGPT’s answer because we all know “systemctl status ssh” will give us an error that ssh. service not found. The correct command is “systemctl status sshd“. We are disappointed because if a person with a beginner level works on this then he could try the second step to install the ssh server and in case ssh is installed he will be quite confused that why it not showing service available . The steps provided by ChatGPT AI is quite basic and maybe if we ask the second time we get other options but we have tried once and in one go we got basic steps.

So in this case 0 points to ChatGPT.

How to formate a 4TB harddisk ?

This is a trick question we have asked here ChatGPT failed to give the right answer. If you get what is wrong in this then congrats you are working on a good data center or Big project. If you are thinking about what is wrong with this then let me tell you above 2TB drive we have to use parted command otherwise you will get the error.

So 0 points to ChatGPT on this trick question.

Related : How to use parted command ?

how to create 500 GB LVM from 1 TB raw device in RedHat Linux?

Awesome now as expected we have got out the correct answer from this popular AI chatbot. You can just copy and paste commands to create LVM in Linux just you need to change names as per your device and requirements.

Again ChatGPT has gained 1 more point.

How to extend 16 TB ext4 LVM to 24 TB in Redhat Linux?

Again ChatGPT failed in the trick question if you know then you are a good Linux Engineer. The issue is that we can not increase the ext4 partition by more than 16TB. After 16TB we have to use the xfs partition. So running all those commands will not give you any results.

Zero points to our ChatGPT

How to change all new user’s home directory in /newhome when we create users by default in Redhat Linux?

I think ChatGPT is very good at user management, So you can ask any question related to user management and just follow it because we got again the right answer.

One more point to ChatGPT.

Create a bash script to delete files from /tmp folder which is older than 60 days in RedHat Linux.

This is just a simple script but it did a good job. For old system admins who use the “-exec rm -f {} \;” newer versions of the find command introduce -delete. So we can say that ChatGPT knows the new find command.

We have tried a simple bash script you can check with the complex script, if you like this article then we will ask ChatGPT other bash script questions.

We have to give 1 point to ChatGPT

How to restrict the root to delete the specific file?

This time ChatGPT shows us that it is just an AI, we all know we can not restrict root like that this could be possible partially but not 100% secure. The only two ways to restrict root are to change attribute and use SELinux which can also restrict root until the root user figure out what the issue is.

In our case, we will 0 points to ChatGPT. If you want to try and give more points let us know in the comments.

Related : What is Selinux ?

How to Disable Selinux ?

Create an NFS service dependent on /sanstorage mount point in Redhat Linux.

In this answer, we will give .5 marks to OpeAI chatbot because there are some other methods that we are using to create dependency for NFS and other services. That is correct but anyone can disable this service and start nfsd service.

So .5 for this answer.

Result

The final result for our question answer session of ChatGPT has got 5.5/10.

5.5/10

As we have seen ChatGPT is accurate to do simple and basic level quetions. But when we tried some trick question this AI chatbot is unable to give answers. As per our question answer we see for local user mangement tasks we can just copy paste but for other task we need to rely on our knowledge. For for the level 1 Job you can use ChatGPT with little guidence. ChatGPT is still learning let see when it cross L2 and L3 level.

Hope this will give you a good idea about OpenAI chatbot.

HOW TO INSTALL POSTGRESQL (PSQL) IN UBUNTU 16.04

0
HOW TO INSTALL POSTGRESQL (PSQL) IN UBUNTU 16.04

HOW TO INSTALL POSTGRESQL (PSQL) IN UBUNTU 16.04

Introduction
In this article we are going to learn How to install Postgresql (psql) in Ubuntu 16.04. Postgresql is a open source database management system. It’s also called as ORDBMS i.e. Object Relational Database Management System. The main developer of Postgresql (psql) is PostgreSQL Global Development Group written the application using C programming language and initially released it’s first version on year 1996 under PostgreSQL License.

The purpose of this application is it stores your data securely in his system called database and user can retrieve the stored data using SQL client application. It’s an cross platform application available for major operating systems i.e. Linux, Unix, Microsoft Windows, Solaris and MacOS. You can download the repository of Postgresql (psql) from Github. There are some limitations has been defined by developer team in Postgresql (psql) i.e. Your table size cannot be more then 32 TB, Maximum field size & row size are 1 GB & 1.6 GB. There is no limitation for database size. You can use unlimited size of database.
For more Information and features of Postgresql (psql) you can visit the official website.
Follow the below steps to install Postgresql (psql) in Ubuntu 16.04
Before start the installation of Postgresql (psql) let’s update the packages & repositories of Ubuntu 16.04 using below command.

elinuxbook@ubuntu:~$ sudo apt-get update # Update Packages & Repositories
Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Reading package lists… Done

After updating the packages & repositories now we are ready to install Postgresql (psql) application and to install so we don’t have to install any 3rd party PPA repository as it’s a part of default repository of Ubuntu 16.04. So let’s go ahead and install the same using below command.

elinuxbook@ubuntu:~$ sudo apt-get install postgresql postgresql-contrib # Install the Package
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
libpq5 postgresql-9.5 postgresql-client-9.5 postgresql-client-common postgresql-common postgresql-contrib-9.5 sysstat
Suggested packages:
postgresql-doc locales-all postgresql-doc-9.5 libdbd-pg-perl isag
The following NEW packages will be installed:
libpq5 postgresql postgresql-9.5 postgresql-client-9.5 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-9.5 sysstat
0 upgraded, 9 newly installed, 0 to remove and 497 not upgraded.
Need to get 4,841 kB of archives.
After this operation, 19.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y —> Enter ‘y’ to continue the installation




Also Read :

As you can see above we have successfully installed the Postgresql (psql) package. Now to confirm the same use the below command.

elinuxbook@ubuntu:~$ sudo dpkg -l postgresql # Confirm installed Package
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
ii postgresql 9.5+173ubuntu0.1 all object-relational SQL database (supported version)

Now to login in to the application you have to switch to root user. So to switch to root user use the below command.
elinuxbook@ubuntu:~$ sudo su # Switch to root User

Now we are ready to login Postgresql (psql) application. By default we have to login the application using the user postgres.  Hence to login the same use the below command
root@ubuntu:/home/elinuxbook# su – postgres # Login the application

Now to get the sql prompt just type the command psql.  Refer the command below.

postgres@ubuntu:~$ psql # Command to get the SQL Prompt
psql (9.5.11)
Type “help” for help.

postgres=# # Postgresql Prompt

For commands and syntax of this application just type the command help or you can also type \h. Refer the command below.
postgres=# help —> For command Help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# \h —> For command Help

By default the postgres user comes with blank password but you can set password for postgres using below command.
postgres=# \password postgres # Set Password
Enter new password: —> Type a new password
Enter it again: —> Retype the Password

To come out from the postgres prompt just type the command \q.

postgres=# \q —> Logout from Postgresql (psql)

This is how we can install Postgresql (psql) in Ubuntu 16.04. If you found this article useful then Like us, Share this post on your preferred Social media, Subscribe our Newsletter OR if you have something to say then feel free to comment on the comment box below.

Google Drive, Microsoft OneDrive, box, DropBox and much more from the CLI — The Ultimate Linux Newbie Guide

0
Google Drive, Microsoft OneDrive, box, DropBox and much more from the CLI — The Ultimate Linux Newbie Guide

I used to use insync to access my Google Drive account from the command line because it was reliable, however insync ceased support for their CLI client, so I had to rethink that.

I’ve decided to plop with rclone because it’s flexible, lightweight, it works well and it supports over 40 different filesharing platforms, including the most popular ones: Google Drive, Dropbox, Box, Microsoft OneDrive, Amazon Drive/S3. It also supports SSH/SFTP – which is nice, because it presents files/directories on another server just as if they are local files.

The installation & configuration steps are listed below

Run the installer

Firstly, either download the installer script and run it in one go, or if you are paranoid about doing that sorta thing then download, inspect it and run it when you are ready.

To download and run the install process in one step simply launch a terminal and type:

ajross@raspberrypi:~$ sudo curl https://rclone.org/install.sh | sudo bash

If you’d prefer to inspect the script first then:

ajross@raspberrypi:~$ curl https://rclone.org/install.sh -O
(have a look at install.sh with an editor like vim, then):
chmod 700 install.sh
sudo ./install.sh

Configure rclone (interactive)

All going well, the rclone application should now be installed and ready to be configured for your particular cloud file storage setup. Here’s the steps I followed (choices made in red & bold font)

ajross@raspberrypi:~ $ rclone config
No remotes found – make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> my_drive (nb you can choose any name you like, don’t use spaces though).
Type of storage to configure.
Enter a string value. Press Enter for the default (“”).
Choose a number from below, or type in your own value
[A list of all the services supported is listed, at the time of writing, number 15 was Google Drive]
Storage> 15
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default (“”).
client_id> (I left this blank)
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default (“”).
client_secret>
(I left this blank)

Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default (“”).
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ “drive”
2 / Read-only access to file metadata and file contents.
\ “drive.readonly”
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ “drive.file”
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ “drive.appfolder”
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ “drive.metadata.readonly”
scope> 1
ID of the root folder
Leave blank normally.

Fill in to access “Computers” folders (see docs), or for rclone to use
a non root folder as its starting point.

Enter a string value. Press Enter for the default (“”).
root_folder_id> (I left this blank)

Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.

Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.

Enter a string value. Press Enter for the default (“”).
service_account_file>
(I left this blank)

Edit advanced config?
y) Yes
n) No (default)
y/n> n
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine

y) Yes (default)
n) No
y/n> n (I did this because I was on a raspberry pi which was not attached to a monitor, you may wish to use Y if you are running X and can see graphical output on the display of the machine you are configuring).
Verification code

Go to this URL, authenticate then paste the code here.

https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id(full url suppressed)

Enter a string value. Press Enter for the default (“”).
config_verification_code> (I pasted the code I got from Google from going to the above URL)
Configure this as a Shared Drive (Team Drive)?

y) Yes
n) No (default)
y/n> n
——————–
[my_drive]
type = drive
scope = drive
token = {“access_token”:-omitted-“}
team_drive =
——————–
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name Type
==== ====
my_drive drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
ajross@raspberrypi:~ $

Check the synchronisation of your data

Although the configuration is now complete, you still need to check the synchronisation of your data:

ajross@raspberrypi:~$ rclone ls my_drive:

Note that the colon (:) is required. The name ‘my_drive’ is the name you supplied earlier during the configuration. All going well, after a few moments you should start to see the list of all your Google Drive (or whatever) files go whizzing by on the display. If you have any issues, just run that command again.

Mount your drive

If all of your files seem present and correct, now it’s time to mount your drive. To do that, make a directory in your home folder to mount it to, and then issue the appropriate mount command:

ajross@raspberrypi:~$ mkdir -p ~/google_drive

ajross@raspberrypi:~$ rclone mount my_drive: ~/google_drive –vfs-cache-mode writes

Depending upon the amount of stuff you have stored, this will take some time do to the initial synchronisation. Feel free to put this task in the background if you like (CTRL-Z and then type bg [RETURN]).

Startup on boot

If you always want to ensure that rclone is running and syncing your content, then you will want to set up the service on boot. You can do this like this:

sudo vim /etc/rc.local

— put the following line in above the line that says ‘exit 0’: —

rclone mount my_drive: /home/<user>/google_drive –vfs-cache-mode writes

Replace my_drive: with whatever drive name you configured and also change <user> with your username.

Done!

That’s it, all going well, you should be able to ‘cd’ into your /home/user/google_drive directory and all your stuff should start appearing in there!

Supported file storage service providers

As of the time of writing, forty-three file sharing services are supported. Here’s the full list:

rclone.org also notes that there are many others, built on standard protocols such as WebDAV or S3, that work out of the box.

Like this:Like Loading…

Using sar Command in Linux to Get System Resource Stats

0
Using sar Command in Linux to Get System Resource Stats

It is said that information is power, and the sar Linux command can give you tons of useful information about your system.It is named like that for System Activity Reporter (SAR), and allows you to query information to your system, to understand what is happening or what has happened in the past.It runs in the background gathering your system information as a daemon, writing the current day to text files and converting these to binary files as midnight passes.The best thing is that it stores the data. So unlike top and many other system monitoring commands, you can get a historical view of system resource utilization.This is helpful when you want to see if a performance deterioration matches with the high resource usage at the time.Installing sar commandThe sar command comes in the sysstat package, which normally will not come by default in Debian or RedHat based distros, so you will have to install it first.sudo apt install sysstatOnce this package is installed, you need to start sar service, by doing:systemctl start sysstat.serviceThis will start the service, which you can easily check if it is running by doing:systemctl status sysstat.serviceAnd you will see results similar to this:Using sar command to get system detailsNow that you have the sar running in the background and collecting the stats, let’s see how you can access that information.💡By default, SAR captures a snapshot of system resource usage every 10 minutes. You should be able to get some good information after some hours of it being activated as a service.CPU StatsTo check the CPU resource, run the sar command with -u option:sar -uIt will show the CPU stats collected for the day.11:50:00 AM CPU %user %nice %system %iowait %steal %idle
12:00:01 PM all 16.22 0.52 3.83 0.44 0.00 79.00
12:10:01 PM all 9.19 0.00 2.15 0.21 0.00 88.45
12:20:01 PM all 11.73 0.06 2.70 0.30 0.00 85.21
12:30:01 PM all 6.03 0.00 2.04 0.16 0.00 91.76
12:40:01 PM all 1.43 0.00 0.44 0.15 0.00 97.98
12:50:01 PM all 8.70 0.00 2.36 0.23 0.00 88.71
01:00:01 PM all 9.10 0.00 2.51 0.21 0.00 88.18
01:10:01 PM all 11.96 0.00 2.81 0.28 0.00 84.95
Average: all 9.28 0.07 2.35 0.25 0.00 88.04You can also ask sar to show you usage at a different time interval.Let’s say you want to watch and monitor the CPU usage stats for 3 times at an interval of 7 seconds:sar -u 7 3It will give you 3 snapshots, taken in the period requested, and an average of those numbers obtained in all snapshots.You can see it gives you the percentage of usage, the percentage of “nice”, the percentage used by the system, the percentage of IO wait, the percentage of steal and the percentage idle.If desired, you can even ask it about specific CPU usage like this:sar -P 1 1 3Check mounted file system usageThe sar command can also give you a lot of information about your File System. In this example, I am going to request information about the filesystems mounted in the system 4 times in intervals of 2 seconds:sar -F 2 4It will not only give you the number of megabytes used and free but also inform you about the inodes free and used and the file system location.Network report is also availableYou can get a lot of information about your network, for example: network interface, network speed, IPV4, TCPV4, ICMPV4 network traffic and errors.sar -n DEV 1 3 | egrep -v loGetting historical statsYou can obtain historical stats by quering the sar command with a specific timeframe. Let’s say you want to know CPU stats from 8 AM to 2 PM for the current day, you would use this:sar -u -s 8:00:00 -e 14:00:00 ConclusionI find it surprising that sar doesn’t provide a utility to display the system resource usage in graphs. If you want that, you can use some third-party tools like sargraph.GitHub – sargraph/sargraph.github.io: SARchart – An opensource version of the tool for viewing Unix SAR data as Charts/GraphsSARchart – An opensource version of the tool for viewing Unix SAR data as Charts/Graphs – sargraph/sargraph.github.ioAs I mentioned at the beginning, the power of sar command is incredible, there are plenty more options to use with it, which will allow you to get a lot more information which is very deep about your system such as: Process, Kernel Thread, I-node, and File Table Details, Swapping Statistics, Messages, Semaphores, and Process Details, I/O Operation Details and much, much more. You can get the list of different options, by running:sar –helpWhich will allow you to see the ser of options the command has to be able to provide deep understanding of the system statistics that can help any administrator to understand what is happening in the system at any moment in time.

Google Extends Linux Kernel Support To Keep Android Devices Secure For Longer

0
Android

Google plans to support its own long-term support (LTS) kernel releases for Android devices for four years, a move aimed at bolstering the security of the mobile operating system. This decision, reported by AndroidAuthority, comes in response to the Linux community’s recent reduction of LTS support from six years to two years, a change that posed potential challenges for Android’s security ecosystem. The Android Common Kernel (ACK) branches, derived from upstream Linux LTS releases, form the basis of most Android devices’ kernels. Google maintains these forks to incorporate Android-specific features and backport critical functionality. Regular updates to these kernels address vulnerabilities disclosed in monthly Android Security Bulletins. While the extended support period benefits Android users and manufacturers, it places significant demands on Linux kernel developers.