Skip to main content

Posts

Showing posts with the label password

How to make terminal ask for password every time you type sudo command

when you type sudo command for the first time in a terminal it will ask you the sudo password. This password will be remembered by that terminal for 15 minutes by default. If you want terminal to ask for password each time you type sudo command just do as said below. 1. Type at terminal sudo visudo 2. Edit as shown below Change Defaults env_reset to Defaults env_reset,timestamp_timeout=0

Recover your Linux Root Password

Just follow the below steps to recover it. 1. Reboot your system and at the GRUB press "e" . Edit the first line and make sure it says "linux single". Then press "b" to boot the new entry line. 2. You will now have access to a BASH prompt. Enter the following commands: cd /etc nano passwd and look for a line somewhere at the top of the file that looks like this: root:x:0:0:root:/root:/bin/bash You must remove the "x" from that line so it will look like this: root::0:0:root:/root:/bin/bash And save the file. 3. Run the following command: nano shadow Edit the first line in the shadow file by removing the encrypted password. The line must now look exactly like this: root:::: Now save the file. 4. Reboot the system and log in as a normal user, then set your new root password using the following commands: $ sudo su $ passwd courtesy: http://www.geekinterview.com/talk/15727-linux-tips-recover-u-r-root.html

SSH login without password

For this you required to generate your own personal set of private/public pair. ssh-keygen is used to generate that key pair for you. On the user’s home directory, on the localhost, type [local-host]$ ssh-keygen -t dsa This will ask you a passphrase. A passphrase is a sequence of words or other text used to control access to a computer system, program or data. A passphrase is similar to a password in usage, but is generally longer for added security. Once entered the passphrase you will be prompted to enter the same passphrase again for confirmation. The private key was saved in .ssh/id_dsa and the public key .ssh/id_dsa.pub. Now, copy the public key to the remote machine [local-host]$ scp .ssh/id_dsa.pub user@remote:~/.ssh/id_dsa.pub Now, login into the remote machine and go to the .ssh directory on the server side [local-host]$ ssh user@remote [remote-host]$ cd .ssh Now, add the client’s public key to the known public keys on the remote machine. [remote-host]$ cat id_d...

Protect your grub by applying a password to it (grub-md5-crypt is broken)

Maybe you want the user to enter a password in order to boot the Recovery Mode or your secondary OS. You have to set that password in the /boot/grub/menu.lst - for higher security you should crypt your password with md5. You have two ways to do that. The first one might-not work for all. 1. You can use the utility 'grub-md5-crypt' to generate the md5. So type at terminal: $ grub-md5-crypt enter your desired password twice and copy the generated crypt-hash into the menu.lst, for example: title Ubuntu (Kernel 2.6.12-9-386) - Recovery Mode password --md5 $1$HSX1$JYNyfBY0pVizk5kyMQOqn/ root (hd0,2) kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda3 ro single initrd /boot/initrd.img-2.6.12-9-386 boot Now reboot and try to start the protected boot-option, enter your password. 2. Reboot your machine and enter the grub-menu. Now press "c" key on your keyboard to enter the command line of grub. Now type: md5crypt Enter your desired 'password' and write d...

Set the default root password

Setting the default root password: Some Live Linux distributions are created without a root password by default (the root account is inactive). This is particularly true with Debian based distributions like Ubuntu. Setting a root password enables us to access some essential tools such as the synaptic installer. In most cases, having no root password is fine when your running from a Live CD and don't need to do administration tasks, make changes or install additional packages. But for those of us who do want to make administrative changes and save them back to a USB device or local storage device on for example a properly created "casper-rw" partition. Setting the root password might then be necessary. How to set the default root password: This process is known to work on most Debian based LIVE distributions like Ubuntu or Pendrivelinux releases previous to Pendrivelinux 2008. Other distributions may vary. Open up a terminal and type sudo passwd root Follow the onscree...

Reset Your Ubuntu Password Easily from the Live CD

Our last article on how to reset your Ubuntu password easily through the grub menu was quite popular, so I've decided to make a series on all the different ways to reset your password on either Linux or Windows… today's lesson is how to use the Live CD to reset the password. Note that we'll also cover how to protect yourself against somebody else resetting your password, so stay tuned! Of course, this method will also work if you've installed your Ubuntu Live CD to a thumb drive . Resetting the Password You'll want to boot from your Ubuntu Live CD, choosing "Try Ubuntu without any change to your computer" from the boot menu. Once the system boots, open up a new Terminal window from Applications \ Accessories and then type in the following command: sudo fdisk -l This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system. Now you'll need to create ...

Reset Your Forgotten Ubuntu Password in 2 Minutes or Less

If you've ever forgotten your password, you aren't alone… it's probably one of the most common tech support problems I've encountered over the years. Luckily if you are using Ubuntu they made it incredibly easy to reset your password. All it takes is adjusting the boot parameters slightly and typing a command or two, but we'll walk you through it. Reset Your Ubuntu Password Reboot your computer, and then as soon as you see the GRUB Loading screen, make sure to hit the ESC key so that you can get to the menu. Root Shell - Easy Method If you have the option, you can choose the "recovery mode" item on the menu, usually found right below your default kernel option. Then choose "Drop to root shell prompt" from this menu. This should give you a root shell prompt. Alternate Root Shell Method If you don't have the recovery mode option, this is the alternate way to manually edit the grub options to allow for a root shell. First you'll ...