1 00:00:00,000 --> 00:00:01,810 [No audio] 2 00:00:01,810 --> 00:00:03,798 Here we will access our Linux machine, the 3 00:00:03,824 --> 00:00:06,574 one we installed earlier through our PuTTy client. 4 00:00:06,682 --> 00:00:10,894 Now remember, you have access to a Linux machine. 5 00:00:10,942 --> 00:00:13,714 You could use PuTTy client or you could simply 6 00:00:13,762 --> 00:00:16,520 log in directly to the client so it's really up to you. 7 00:00:17,150 --> 00:00:18,478 So this is the PuTTy client. 8 00:00:18,514 --> 00:00:20,734 Looks like we're going to connect to our Linux machine 9 00:00:20,782 --> 00:00:24,090 which is our first Linux machine through the PuTTy. 10 00:00:24,830 --> 00:00:27,390 Let's go to our Linux machine. 11 00:00:27,390 --> 00:00:29,740 [No audio] 12 00:00:29,740 --> 00:00:33,014 Here, we have our Linux machine, and that's our console. 13 00:00:33,061 --> 00:00:34,880 We log into the console, 14 00:00:34,880 --> 00:00:40,036 [No audio] 15 00:00:40,036 --> 00:00:41,730 and then we open up a terminal. 16 00:00:41,730 --> 00:00:43,202 And that's how we perform most of 17 00:00:43,216 --> 00:00:44,922 our tasks, most of our commands. 18 00:00:45,006 --> 00:00:47,630 Now another way to connect is through the PuTTY. 19 00:00:48,190 --> 00:00:50,678 For that we have to assign an 20 00:00:50,704 --> 00:00:53,478 IP address to this Linux machine. 21 00:00:53,574 --> 00:00:54,890 So what is the IP address 22 00:00:54,940 --> 00:00:59,390 right now. The command to check is ifconfig. 23 00:00:59,390 --> 00:01:07,010 [No audio] 24 00:01:07,010 --> 00:01:09,642 So when we scroll up, you see here 25 00:01:09,716 --> 00:01:14,046 our network adapter is this enp0s3. 26 00:01:14,108 --> 00:01:15,798 But it doesn't have an IP address. 27 00:01:15,944 --> 00:01:18,666 So how do we assign an IP address which 28 00:01:18,848 --> 00:01:23,814 we will go into our Oracle VirtualBox, click 29 00:01:23,852 --> 00:01:28,294 on Setting, and go to Network, change the NAT 30 00:01:28,462 --> 00:01:30,208 to Host-only Adapter, 31 00:01:30,208 --> 00:01:45,814 [No audio] 32 00:01:45,814 --> 00:01:46,814 and click OK. 33 00:01:47,730 --> 00:01:49,485 Once it is saved, 34 00:01:49,485 --> 00:01:57,285 [No audio] 35 00:01:57,285 --> 00:01:59,862 you can simply run ifconfig 36 00:01:59,862 --> 00:02:03,830 command again, and then you scroll up, and you'll see, 37 00:02:03,880 --> 00:02:05,980 right now it still does not have 38 00:02:06,430 --> 00:02:08,822 the ethernet IP address right here. 39 00:02:08,895 --> 00:02:10,490 It should come up somewhere here. 40 00:02:10,600 --> 00:02:13,994 So I think probably the adapter is not up. 41 00:02:14,032 --> 00:02:15,609 So we will have to become root 42 00:02:15,609 --> 00:02:21,082 [No audio] 43 00:02:21,082 --> 00:02:26,422 and type in command ifcfg, sorry ifup, 44 00:02:27,422 --> 00:02:34,830 and the name of the adapter, which is enp0s3. 45 00:02:36,630 --> 00:02:38,062 Once you hit that, it 46 00:02:38,076 --> 00:02:40,330 says, Connection successfully activated. 47 00:02:40,830 --> 00:02:42,050 Let's wait for the prompt. 48 00:02:42,110 --> 00:02:44,558 The prompt came back, hit up arrow 49 00:02:44,594 --> 00:02:47,734 key, and look for ifconfig again. 50 00:02:47,892 --> 00:02:49,978 And this time you see it has an 51 00:02:50,004 --> 00:02:57,586 IP address which is 192.168.56.101. 52 00:02:57,586 --> 00:03:17,350 [No audio] 53 00:03:17,350 --> 00:03:18,938 Now we're going to put in that 54 00:03:18,964 --> 00:03:21,606 IP address in a PuTTy terminal. 55 00:03:21,798 --> 00:03:24,218 Okay, once again, for my Mac users you 56 00:03:24,244 --> 00:03:26,370 do not need to download and install PuTTy. 57 00:03:26,430 --> 00:03:28,502 All you have to do is find your terminal on 58 00:03:28,516 --> 00:03:33,390 your Mac and then simply run the command ssh, lowercase, 59 00:03:33,450 --> 00:03:39,654 -l, username in my case is iafzal, and IP 60 00:03:39,702 --> 00:03:44,486 addresses which is 192.168.56.101, and that's the IP address. 61 00:03:44,548 --> 00:03:46,994 We just looked it up by running 62 00:03:47,092 --> 00:03:50,502 the command ip addre, or ip a. 63 00:03:50,586 --> 00:03:52,694 So use the syntax and you will be able 64 00:03:52,732 --> 00:03:56,526 to connect to Linux machine from your Mac. 65 00:03:56,658 --> 00:03:58,970 Now I'm going back to my 66 00:03:59,020 --> 00:04:01,350 Windows users and using the PuTTy. 67 00:04:01,410 --> 00:04:03,770 So we could use PuTTy to connect to Linux. 68 00:04:03,770 --> 00:04:06,010 [No audio] 69 00:04:06,010 --> 00:04:13,300 192.168.56.101, hit Enter. 70 00:04:13,630 --> 00:04:15,570 Or you could also save the session 71 00:04:15,630 --> 00:04:21,950 saying MyLinuxVM like that. 72 00:04:22,060 --> 00:04:23,942 You could save it this way, next time you 73 00:04:23,956 --> 00:04:26,137 don't have to type in the IP address and 74 00:04:26,164 --> 00:04:28,214 then you click here, and then click Open. 75 00:04:28,372 --> 00:04:31,420 Once it opens, it ask you for a warning sign. 76 00:04:31,870 --> 00:04:33,038 It's going to tell you if you 77 00:04:33,064 --> 00:04:35,106 wanted to keep the SSH keys. 78 00:04:35,238 --> 00:04:37,538 It's just a secure way to 79 00:04:37,564 --> 00:04:39,160 connect to Linux, just click Yes. 80 00:04:40,030 --> 00:04:41,642 It's going to say login as. 81 00:04:41,716 --> 00:04:43,862 Now I'm going to login as myself 82 00:04:43,996 --> 00:04:47,054 iafzal, and you probably have your own account, 83 00:04:47,152 --> 00:04:49,537 login with your own account, hit Enter. 84 00:04:49,537 --> 00:04:52,140 [No audio] 85 00:04:52,140 --> 00:04:54,222 Put the password, and there you go. 86 00:04:54,296 --> 00:04:57,678 This is exactly as if you 87 00:04:57,704 --> 00:04:59,266 are logging in through the GUI. 88 00:04:59,398 --> 00:05:01,734 Now, the reason we need to know how to log 89 00:05:01,772 --> 00:05:05,586 in through the PuTTy is because 98% of the time 90 00:05:05,648 --> 00:05:07,534 when you are going to be working in a corporate 91 00:05:07,582 --> 00:05:10,662 environment, there is no GUI environment where you're going to 92 00:05:10,676 --> 00:05:12,370 come in and login to the GUI. 93 00:05:12,490 --> 00:05:15,190 You're always going to have the PuTTy session where you're 94 00:05:15,190 --> 00:05:18,046 going to put an IP address of the destination server 95 00:05:18,178 --> 00:05:19,938 and then you're going to connect to it. 96 00:05:20,024 --> 00:05:22,146 Now, if you type hostname, you're going 97 00:05:22,148 --> 00:05:24,150 to see your hostname right here. 98 00:05:24,200 --> 00:05:28,146 So this exactly as this one right here. 99 00:05:28,268 --> 00:05:32,478 So in our lessons down, after this 100 00:05:32,504 --> 00:05:35,398 lesson, we're going to be using interchangeably. 101 00:05:35,554 --> 00:05:38,086 Sometimes you're going to be using PuTTy, sometimes you're 102 00:05:38,098 --> 00:05:40,438 going to be logging in as a console. 103 00:05:40,474 --> 00:05:43,206 So it's really doesn't matter where we logging in from. 104 00:05:43,328 --> 00:05:45,840 But you should know both ways how to log in. 105 00:05:45,840 --> 00:05:47,072 [No audio]