Linux Essentials For Hackers - #10 - Shells & Bash Configuration
Key Takeaways
The video covers Linux essentials for hackers, focusing on shells and bash configuration, including switching between shells, changing the default login shell, and configuring bash rc files.
Full Transcript
hey guys welcome back to the linux essentials for hacker series in this video i'm going to be talking about shells now this might be a little bit confusing for you if you're a beginner to linux but um you the only thing you need to understand is that your the various types of shields you can use on linux now if you're using ubuntu or debian the default shell that you'll be you'll be given is going to be called the bash shell all right and again i can confirm this by echoing my variable my shell variable here so i can say echo shell and again it tells you the the current shell that i'm using which is bash now bash is an acronym for the born again shell uh so that means that there was a born shell and you're familiar with it and that is the sh or the sh shell so uh all of these shells uh can be used to to actually work with the linux system that's uh that's entirely up to you my objective in this video is to explain how to change your default shell and not work with the bash shell all right now on linux if you want to actually display all the shelves that you currently have that can be used you can essentially just read the contents of the shells file in the etsy directory and i can hit enter and you can see it's going to tell me it's going to tell you the valid login shells you have so we have the born shell which is the sh we have the born again shell which is bash which is the preferred shell to use you then have our bash and dash which is pretty good and then you have fish now i just installed fish and again many of you have been asking me to cover this i'll explain it after after actually explained passion how to use it also how to customize it and stuff like that so for the purpose of this video i'm going to be using i'm going to be using bash and i'll later on cover the other the other shelves that you can use and you know using fish so the first thing is how to switch from shell to shell within a given terminal instance so i'm currently using the bash shell if i wanted to switch into the bond shell i can just hit sh and hit enter and you can see i'm now in the bone shell and again all the linux commands work perfectly fine i can hit all the various linux commands that i could run so i can list all the files in here etc etc you get the idea right so i can then say cat etsy shelves and again we can take a look at the shelves we have i can now go back into bash i can go into dash if i want to and again that takes me to in into into dash you can say echo and we can again confirm this and hit enter and it tells us we're still in pin bash that is because we're currently within this instance but if i changed it as my default login shell which i'll show you in a second how to do so let me just go back into bash and we will actually let me just clear this out so there we are right so you can see how easy it is to switch between shields in a particular terminal instance now by default as a user account on a linux system uh a you will be specified a particular shell to use and that can be found in the password file so if i hit enter so let me just prep it and display my account you can see that the shell is specified here and i'll explain this when talking about users and groups you can see that uh the default login shell that i have been specified to use is the bash shell which is perfectly fine now the great thing about linux is when creating the user you can specify the shell that they're going to use however you can also change the shell of the user or the user can change the shell that they want to use when they log in or every time they log in and the way we do that is by using the change shell command or the change shell utility which is defined by chsh or that's an actual abbreviation of the command so i can type in what is chsh and i'm gonna hit enter and you can see it tells you this allows you to change the login shell all right so if i want to change um the default login shell all i need to do is let me first display the shells that i have here one more time all i need to specify is their relative path all right so if i say chs8 it's going to ask me for the password of my user here i'm going to enter and it's going to say changing the login shell for the user lexis enter new value or press enter for the default the default login shell for me is bash so if i wanted to change it to to fish for example i would say user sorry that is user uh bin and i say fish and i'm going to hit enter and that changes it for me all right so what this means in essence if i type in cat hc password here what this means let me just display the results here you can see that it changes uh the default login shell so this means that uh when i log out and i log back in uh what's going to happen is that i'm going to be given the face shell as my default shell instead of bash so if you're wondering what the fish shell is you can install it very easily by typing sudo apt install or apt-get install whatever you find is useful for you just hit enter and i already have it installed so that's how to install it so what is fish fish is a friendly is a friendly interactive show it's a great show for beginners extremely customizable and you can see once i typed in fish it allowed me to log in the great thing about fish is it laws allows me to actually it actually gives me predictions in regards to the commands that i might be interested in running we'll get to this in a second let me go into bash all right so that is how to change your default login shell all right so again i'm right now i'm currently set to use fish as the default shell when i log in every time but let's talk about bash because that's uh that's the primary goal of this video because it's the most used shell and the one you'll be coming across mostly so in my current home directory so in the user lexis directory here i have various bash files bash configuration files uh within this directory so i'm just going to grab them and i'll say bash and the of course they're going to be hidden so i'm just going to hit enter and as you can see i have a bash aliases file which you're not going to have by default i created this and i created it to to prove a point and to actually demonstrate an example here we then have the bash history uh file which has uh all your history of all your commands and this is very different to your actual gnu history utility [Music] you have bash log out and bash rc bash rc is your bash configuration file i'm not going to cover how to configure it it's extremely straightforward and you can pretty much configure it directly by using the preferences tab right over here but we can take a look at it i just want to show you how it is so and if we take a look at it here through vim you can see that um it essentially allows you to to configure set variables i change the color change the the size of the history of the history file um let's see what else you can actually do here so there you can you can change the color this is all to do with color and you can you can do a lot of other stuff with uh in regards to customizing how it appears and and how it works so for example if i wanted um if i wanted bash to actually run the fish shell instead of the bash shell every time i started up i started bash up i would type in fish right just at the bottom here and let me save this file now and if i open up a new terminal you can see immediately it opens up the fish shell so that's pretty cool but this isn't the correct way of doing it or the preferred way of doing it so i'll just get rid of this fish command here and i'll save the changes here all right so now that we've talked about um now that we've talked about the bash rc file let's talk about the bash history file which is very important all right so by default in linux you have the history command which again let me just type it in the history command is essentially the new history library now the the history uh this essentially allows you to to actually check uh a lot it stores a history of all the commands you've run and uh you know you can clear your history very easily by typing in history c right and it's as simple as that but it's not to be mistaken or confused with bash history which is again uh is specific to the bash shell or the bone again shell so again this file will contain a list of all the commands that i've run and and i'll show you how to clear it so if i get the contents of the file uh you can see that it it has all of these commands that i've been running so far you know perfectly fine uh and uh if i wanted to clear it it's very easy i can just redirect the the contents of the so i can say dev null and then [Music] i can redirect the output into the actual bash history file play bash history here hit enter clear this out if i now try and catch the contents of the bash history file you can see it has nothing so i've been able to clear my bash history i think i've covered this in my one of the videos where i spoke about uh actually clearing your tracks on linux so this is a great way of doing that and of course you can then use the history command if you want to do that so that's to do with actually using the um with actually working with the actual bash history here now let me talk about the bash aliases file all right so the aliases file is very simple it allows you to specify aliases or command aliases that you'd like to use now you can just create a file within your home directory and just name it bash aliases so what i'll do is i'll actually just show you the contents of the file so i can just show it show it to you right over here so bash aliases hit enter and you can see i have two aliases i have alias update which runs the command sudo apt-get update and then i have upgrade which runs the command sudo apt-get upgrade so it's fairly simple to understand what happens so i can just type in update and that will update my packages and then i can type in upgrade and that will upgrade my packages instead of typing the commands over and over again so that is what uh you know the command aliases are and how to specify them so again it's very simple in regards to configuring it that's pretty much it for this video guys let me know if you have any questions or suggestions and i'll be seeing you in the next video you
Original Description
Welcome to the Linux Essentials For Hackers series, where we will be covering the 20% you need to know to be efficient with Linux. In this video, we will be covering the various shells on Linux and how to configure the bash shell.
This series is sponsored by Linode, use the link below to get 20$ in free credits.
https://promo.linode.com/hackersploit/
Promo code: HACKERSPLOIT20
◼️Get Our Courses:
Python For Ethical Hacking: https://www.udemy.com/python-for-ethical-hacking-develop-pentesting-tools/?couponCode=PFEHJUN
Ethical Hacking Bootcamp: https://www.udemy.com/the-complete-ethical-hacking-bootcamp/?couponCode=TCEHB2019
◼️Our Platforms:
Blog: https://hsploit.com/
HackerSploit Forum: https://hackersploit.org/
HackerSploit Cybersecurity Services: https://hackersploit.io
HackerSploit Academy: https://www.hackersploit.academy
HackerSploit Discord: https://discord.gg/j3dH7tK
HackerSploit Podcast: https://soundcloud.com/hackersploit
iTunes: https://itunes.apple.com/us/podcast/the-hackersploit-podcast/id1439732519?mt=2
◼️Support us by using the following links:
Patreon: http://patreon.com/hackersploit
I hope you enjoy/enjoyed the video.
If you have any questions or suggestions feel free to post them in the comments section or on my social networks.
Social Networks - Connect With Us!
-------------------------------
Facebook: https://www.facebook.com/HackerSploit/
Twitter: https://twitter.com/HackerSploit
Instagram: https://www.instagram.com/hackersploit/
Patreon: http://patreon.com/hackersploit
--------------------------------
Thanks for watching!
Благодаря за гледането
Kiitos katsomisesta
Danke fürs Zuschauen!
感谢您观看
Merci d'avoir regardé
دیکھنے کے لیے شکریہ
देखने के लिए धन्यवाद
Grazie per la visione
Gracias por ver
شكرا للمشاهدة
#Linux#Hacking#bash
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from HackerSploit · HackerSploit · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How To Install Kali Linux 2.0 On Virtual Box
HackerSploit
100 Subscriber Q&A! - How I Learned Ethical Hacking
HackerSploit
BlackArch Linux Review - Better Than Kali Linux?
HackerSploit
How to Access the Deep Web Safely | Deep Web Starter Guide 1.0
HackerSploit
Wireshark Tutorial for Beginners - Installation
HackerSploit
Wireshark Tutorial for Beginners - Overview of the environment
HackerSploit
Wireshark Tutorial for Beginners - Capture options
HackerSploit
Wireshark Tutorial for Beginners - Filters
HackerSploit
Complete Ethical Hacking Course - Become a Hacker Today - #1 Hacking Terminology
HackerSploit
Complete Ethical Hacking Course #2 - Installing Kali Linux
HackerSploit
Parrot OS 3.5 Review | The Best Kali Linux Alternative
HackerSploit
Nmap Tutorial For Beginners - 1 - What is Nmap?
HackerSploit
Katoolin | How To Install Pentesting Tools On Any Linux Distro
HackerSploit
Nmap Tutorial For Beginners - 2 - Advanced Scanning
HackerSploit
Nmap Tutorial For Beginners - 3 - Aggressive Scanning
HackerSploit
Zenmap Tutorial For Beginners
HackerSploit
How To Setup Proxychains In Kali Linux - #1 - Stay Anonymous
HackerSploit
How To Setup Proxychains In Kali Linux - #2 - Change Your IP
HackerSploit
How To Change Mac Address In Kali Linux | Macchanger
HackerSploit
How To Setup And Use anonsurf On Kali Linux | Stay Anonymous
HackerSploit
Ubuntu 17.04 "Zesty Zapus" Review - Bye Unity
HackerSploit
VPN And DNS For Beginners | Kali Linux
HackerSploit
Tails OS Installation And Review - Access The Deep Web/Dark Net
HackerSploit
Steganography Tutorial - Hide Messages In Images
HackerSploit
The Lazy Script - Kali Linux 2017.1 - Automate Penetration Testing!
HackerSploit
Best Linux Distributions For Penetration Testing
HackerSploit
Netcat Tutorial - The Swiss Army Knife Of Networking - Reverse Shell
HackerSploit
Gaining Access - Web Server Hacking - Metasploitable - #1
HackerSploit
Web Server Hacking - FTP Backdoor Command Execution With Metasploit - #2
HackerSploit
How To Install Kali Linux On VMware - Complete Guide 2018
HackerSploit
Q&A #1 - Best Cyber-security Certifications?
HackerSploit
Terminator - Kali Linux - Multiple Terminals
HackerSploit
Shodan Search Engine Tutorial - Access Routers,Servers,Webcams + Install CLI
HackerSploit
Q&A #2 - Mr Robot?
HackerSploit
Metasploit Community Web GUI - Installation And Overview
HackerSploit
Linux Expl0rer - Forensics Toolbox - Installation & Configuration
HackerSploit
QuasarRAT - The Best Windows RAT? - Remote Administration Tool for Windows
HackerSploit
Metasploit For Beginners - #1 - The Basics - Modules, Exploits & Payloads
HackerSploit
Metasploit For Beginners - #2 - Understanding Metasploit Modules
HackerSploit
Kali Linux Quick Tips - #1 - Adding a non-root user
HackerSploit
Metasploit For Beginners - #3 - Information Gathering - Auxiliary Scanners
HackerSploit
Spectre Meltdown Vulnerability - How To Check Your System
HackerSploit
Metasploit For Beginners - #4 - Basic Exploitation
HackerSploit
ARP Spoofing With arpspoof - MITM
HackerSploit
WordPress Vulnerability Scanning With WPScan
HackerSploit
Generating A PHP Backdoor with weevely
HackerSploit
Nikto Web Vulnerability Scanner - Web Penetration Testing - #1
HackerSploit
How To Install Kali Linux On Windows 10 - Windows Subsystem For Linux
HackerSploit
Stacer - System Optimizer And Monitoring Tool For Linux
HackerSploit
Kali Linux 2018.1 - Kernel Updates & Patches
HackerSploit
MITM With Ettercap - ARP Poisoning
HackerSploit
Password Cracking With John The Ripper - RAR/ZIP & Linux Passwords
HackerSploit
How To Detect Rootkits On Kali Linux - chkrootkit & rkhunter
HackerSploit
Channel Updates - How To Post Questions & Video Suggestions
HackerSploit
Web App Penetration Testing - #1 - Setting Up Burp Suite
HackerSploit
Web App Penetration Testing - #2 - Spidering & DVWA
HackerSploit
Cl0neMast3r - GitHub Repository Cloning Tool
HackerSploit
Kali Linux On Windows 10 Official - WSL - Installation & Configuration
HackerSploit
DoS/DDoS Protection - How To Enable ICMP, UDP & TCP Flood Filtering
HackerSploit
Web App Penetration Testing - #3 - Brute Force With Burp Suite
HackerSploit
More on: Security Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI