TERMINAL LOCK

TERMINAL LOCK

AIM:

-->WHILE ASKING USER FOR PASSWORD WHILE INSTALLING TERMINAL LOCK

-->EVERYTIME ASKS FOR PASSWORD WHEN WE OPEN TERMINAL

STEP 1:

-->We have to Write a Script File to Lock the Terminal Using Below Code

No alt text provided for this image
#!/bin/bash        


This Command is Shebang is a Special Sequence of Characters .This command used to tell the kernel which interpreter should be used to run the commands present in the file.

password=$(zenity --password)        

zenity is a Special Graphical Feature .zenity is a open source and a cross-platform application .Which displays GTK+ Dialog Boxes In command line or Shell Script .

-->Our password is "teju" if we entered correct password it will print Welcome teju using figlet command

figlet "Welcome Teju"        


Otherwise It will print Who are you and it kills the process and it close the terminal using below command.

kill $(pgrep terminal)        


Step-2:

Now our Script file is done but we have to execute the file ..but We have to give permission to the file using chmod command.

No alt text provided for this image

Step-3:

Now we run the Script File it asks Password but Our Aim is to asks password when we open terminal .So we have to add our script file to .bashrc file.

No alt text provided for this image

Now We open the terminal it will Asks Password.

No alt text provided for this image

Successfully We Locked the Terminal.


Pushpakumar Diddekunta

Aspiring JAVA DEVELOPER || Linux 🐧|| python🐍 ||Java ☕|| Robotics 🤖 || IOT || IIIT RK-VALLEY 📚 || ECE 2025 📖

3y

🤩Wow.... Nice akka

Like
Reply

To view or add a comment, sign in

More articles by Tejaswi Manda

  • 👉TASK ON LINUX👈

    NAME:MANDA NAGA PARVATHI TEJASWI COLLEGE NAME:RGUKT , IIIT ONGOLE TASK BASED ON BOTH LINUX SESSIONS 1)Create a file via…

  • ARTICLE ON GIT & GITHUB

    NAME:NAGA PARVATHI TEJASWI UNIVERSITY NAME:RGUKT IIIT ONGOLE EXPERIENCE:It was nice experienced by REGex TEAM and…

Insights from the community

Others also viewed

Explore topics