1 00:00:00,000 --> 00:00:01,800 [No audio] 2 00:00:01,800 --> 00:00:05,340 Changing password. In this lesson, we will cover 3 00:00:05,490 --> 00:00:08,940 how you could change the user password. Either you 4 00:00:08,940 --> 00:00:11,130 are root and you force the user to change the 5 00:00:11,130 --> 00:00:14,400 password the first time you log in. Or if you are 6 00:00:14,400 --> 00:00:16,830 just yourself and you want to change your own 7 00:00:16,830 --> 00:00:21,570 password. You should change your initial password 8 00:00:21,600 --> 00:00:24,900 as soon as you login. Now, this is when your 9 00:00:24,900 --> 00:00:27,150 account is created for the first time in the 10 00:00:27,150 --> 00:00:29,850 system, and you log in with a password that's been 11 00:00:29,850 --> 00:00:32,820 given to you. Or sometimes what happens is a 12 00:00:32,820 --> 00:00:35,580 password is not given to you, you would just log 13 00:00:35,580 --> 00:00:38,370 in with your username, and it will automatically 14 00:00:38,370 --> 00:00:43,350 prompt you to put in a new password. To change a 15 00:00:43,350 --> 00:00:47,250 password that command is passwd is followed by 16 00:00:47,280 --> 00:00:50,700 the userid. The password is not the entire word 17 00:00:50,760 --> 00:00:57,030 is just passwd. It does not have o and r in 18 00:00:57,030 --> 00:01:01,560 it. So it's passwd userid and userid in 19 00:01:01,560 --> 00:01:06,840 my case is iafzal. When you hit enter, it will 20 00:01:06,870 --> 00:01:10,230 ask you for your old password or your existing 21 00:01:10,230 --> 00:01:13,830 password that you have. You provide that password, 22 00:01:14,790 --> 00:01:17,670 the next thing it will ask you is to put in your 23 00:01:17,670 --> 00:01:21,780 new password. You input your new password, it will 24 00:01:21,780 --> 00:01:25,290 reconfirm the new password for it. So it will ask 25 00:01:25,290 --> 00:01:28,140 you retype your new password. The reason that they 26 00:01:28,140 --> 00:01:30,840 asked for the second time is because if you have 27 00:01:31,170 --> 00:01:35,430 made a mistake in your earlier entry of adding new 28 00:01:35,430 --> 00:01:38,490 password, it will match to confirm that you have 29 00:01:38,490 --> 00:01:45,078 added the right password. Now, if you just type passwd 30 00:01:45,078 --> 00:01:48,330 while you are root, remember, it will 31 00:01:48,360 --> 00:01:54,330 change your root password. If you type passwd 32 00:01:54,330 --> 00:01:56,880 followed by userid, then it will change the 33 00:01:56,880 --> 00:02:00,780 password of that user. So let's log into our Linux 34 00:02:00,780 --> 00:02:03,720 machine through console and see how we could 35 00:02:03,720 --> 00:02:05,521 change our user password. 36 00:02:05,521 --> 00:02:14,014 [No audio] 37 00:02:14,014 --> 00:02:15,180 Here we have our Linux 38 00:02:15,180 --> 00:02:18,000 machine console, I'll just do a right click and 39 00:02:18,000 --> 00:02:22,230 open the terminal. I always like to make this 40 00:02:22,260 --> 00:02:28,440 terminal a lot bigger, make the window bigger. I 41 00:02:28,440 --> 00:02:31,950 could just simply drag and drop or I could simply 42 00:02:31,950 --> 00:02:35,460 maximize it by clicking here. Anyway, let's get 43 00:02:35,460 --> 00:02:39,030 into our changing password. So when I type 44 00:02:39,570 --> 00:02:46,650 passwd, followed by my userid it says, Only 45 00:02:46,650 --> 00:02:51,630 root can specify a user name. So only root has 46 00:02:51,630 --> 00:02:54,720 the rigth to specify the username. I'm not root, I'm 47 00:02:54,750 --> 00:03:00,960 being myself, who am I, whoami, I am myself, so all I 48 00:03:00,960 --> 00:03:04,950 will do is just put in just passwd command, not 49 00:03:04,950 --> 00:03:09,210 the username, I would hit enter and now it's 50 00:03:09,240 --> 00:03:12,240 asking me to change or to provide my current 51 00:03:12,240 --> 00:03:14,910 password. So I'm going to put in my current 52 00:03:14,910 --> 00:03:18,090 password. Now it's asking me for a new password. 53 00:03:18,180 --> 00:03:20,640 Now remember I'm gonna put in, this I'm just gonna 54 00:03:20,640 --> 00:03:24,780 put it 1234. And let's see what it says. It says, The 55 00:03:24,780 --> 00:03:27,870 password is shorter than 8 characters. So 56 00:03:27,870 --> 00:03:34,410 let's put in 12345678 and it says, The password fails 57 00:03:34,410 --> 00:03:39,450 the dictionary check. So now Unix or most of 58 00:03:39,450 --> 00:03:42,270 the operating system nowadays have this check 59 00:03:42,300 --> 00:03:44,850 where it looks for a dictionary and see if that 60 00:03:44,850 --> 00:03:48,480 password exists, of course to see if that word exists or not. 61 00:03:48,780 --> 00:03:52,380 So make sure you change you change the password to 62 00:03:52,380 --> 00:03:57,990 something that does not go with dictionary. I'm 63 00:03:57,990 --> 00:04:01,230 gonna change it to something different. There you 64 00:04:01,230 --> 00:04:08,040 go, see it took it. I'm going to reconfirm it and 65 00:04:08,460 --> 00:04:11,340 passwd: all authentication tokens updated 66 00:04:11,370 --> 00:04:15,330 successfully. So that's this command to change the 67 00:04:15,330 --> 00:04:18,480 password, and I want you to try that command, try 68 00:04:18,480 --> 00:04:22,170 couple of different types, different ways, 69 00:04:22,260 --> 00:04:25,079 become root and change your password by typing 70 00:04:25,079 --> 00:04:29,340 passwd iafzal, your username, and then login 71 00:04:29,370 --> 00:04:31,322 as yourself and try that command. 72 00:04:31,322 --> 00:04:36,288 [No audio]