WEBVTT - This file was automatically generated by VIMEO

0
00:00:13.500 --> 00:00:16.400
Hey, welcome back to this

1
00:00:16.400 --> 00:00:16.500
 video.

2
00:00:17.400 --> 00:00:20.200
So in this video we are going to see how you can

3
00:00:20.200 --> 00:00:24.000
 perform SSH now SSH is

4
00:00:23.600 --> 00:00:26.300
 used to do a remote

5
00:00:26.300 --> 00:00:30.100
 login into another host device or

6
00:00:29.100 --> 00:00:32.600
 in simple words another Linux operating

7
00:00:32.600 --> 00:00:32.900
 system.

8
00:00:34.300 --> 00:00:37.700
Alright, so, let's see how to do it. So in this

9
00:00:37.700 --> 00:00:40.700
 lesson we are going to perform three different ways

10
00:00:40.700 --> 00:00:43.300
 to do SSH. So let's

11
00:00:43.300 --> 00:00:46.400
 quickly begin with now as you

12
00:00:46.400 --> 00:00:49.600
 can see on the screen. This is my OS number

13
00:00:49.600 --> 00:00:52.600
 one or host one, which is the Mac OS

14
00:00:52.600 --> 00:00:55.900
 and I also have my second

15
00:00:55.900 --> 00:00:58.400
 OS which is the host to

16
00:00:58.400 --> 00:01:02.000
 which is the parrot OS perfect. So

17
00:01:01.300 --> 00:01:04.700
 now I'm going to log in into my

18
00:01:04.700 --> 00:01:08.400
 parrot OS which is this operating system from my

19
00:01:07.400 --> 00:01:10.100
 host one, which is the Mac

20
00:01:10.100 --> 00:01:11.000
 operating system.

21
00:01:11.900 --> 00:01:14.300
Now let me quickly see the

22
00:01:14.300 --> 00:01:17.400
 IP address of this device to home which

23
00:01:17.400 --> 00:01:20.100
 we are going to log in and you can see the IP was

24
00:01:20.100 --> 00:01:24.600
 192.168.0.69.

25
00:01:25.300 --> 00:01:28.900
Now to login into the Remote device

26
00:01:28.900 --> 00:01:31.400
 we are going to use the command which is

27
00:01:31.400 --> 00:01:34.300
 SSH and the IP address of

28
00:01:34.300 --> 00:01:37.700
 the remote host which is the host 2 in

29
00:01:37.700 --> 00:01:40.700
 our case, which is our parrot operating system.

30
00:01:41.600 --> 00:01:43.800
now once we give the IP address

31
00:01:44.800 --> 00:01:47.500
we simply need to hit enter and you

32
00:01:47.500 --> 00:01:51.200
 can see it will by default give Rohit

33
00:01:50.200 --> 00:01:53.800
 at the rate the IP address and it

34
00:01:53.800 --> 00:01:56.400
 is asking for a password prompt now

35
00:01:56.400 --> 00:01:59.500
 it is by default trying us to

36
00:01:59.500 --> 00:02:02.800
 login into the default user, which is Rohit now.

37
00:02:04.100 --> 00:02:07.300
Once I give the correct password, I will be

38
00:02:07.300 --> 00:02:10.400
 able to successfully log in into the operating system

39
00:02:10.400 --> 00:02:13.500
 as you can see Rohit at the rate parrot and

40
00:02:13.500 --> 00:02:16.500
 I'm successfully logged in into the

41
00:02:16.500 --> 00:02:19.600
 remote OS and I can control the whole operating system

42
00:02:19.600 --> 00:02:22.800
 from here perfect. Now, let me simply exit

43
00:02:22.800 --> 00:02:25.500
 from here which is basically logout and

44
00:02:25.500 --> 00:02:28.200
 the connection gets closed. So we have seen

45
00:02:28.200 --> 00:02:31.500
 the first way which was simply SSH and

46
00:02:31.500 --> 00:02:34.600
 the IP address of the remote host now.

47
00:02:35.900 --> 00:02:38.200
In case you need to log in through

48
00:02:38.200 --> 00:02:41.800
 a specific user only in our first

49
00:02:41.800 --> 00:02:44.600
 case it was Rohit but let's say I want

50
00:02:44.600 --> 00:02:47.400
 to login using a admin user. So for

51
00:02:47.400 --> 00:02:50.500
 that you can simply specify the name of

52
00:02:50.500 --> 00:02:53.600
 the user add the rate the IP address

53
00:02:53.600 --> 00:02:58.000
 of the remote host. So as you can see SSH admin

54
00:02:57.200 --> 00:03:00.600
 at the rate IP address of the remote host

55
00:03:00.600 --> 00:03:03.700
 where we want to login just specify the

56
00:03:03.700 --> 00:03:07.000
 password and you will be able to login into

57
00:03:06.400 --> 00:03:09.000
 the remote machine as you can

58
00:03:09.700 --> 00:03:11.500
 see I have successfully logged in.

59
00:03:12.100 --> 00:03:15.400
Now I have typed the command which is who am I

60
00:03:15.400 --> 00:03:18.200
 to confirm and you can see the user which

61
00:03:18.200 --> 00:03:21.300
 has successfully logged in is admin perfect.

62
00:03:22.600 --> 00:03:26.000
So this was our second way to do SSH using

63
00:03:25.500 --> 00:03:28.900
 a username now, let

64
00:03:28.900 --> 00:03:31.300
 us see the third way in which we are

65
00:03:31.300 --> 00:03:35.600
 going to SSH into the remote host using the

66
00:03:34.600 --> 00:03:37.000
 default port number.

67
00:03:38.300 --> 00:03:41.400
Now we always know that SSH uses the

68
00:03:41.400 --> 00:03:44.900
 default Port which is Port 22, which

69
00:03:44.900 --> 00:03:47.300
 you can specify using the

70
00:03:47.300 --> 00:03:50.400
 flag - P which stands for

71
00:03:50.400 --> 00:03:54.300
 the port number and the port number is 22 now.

72
00:03:53.300 --> 00:03:56.800
 I will simply hit enter and it

73
00:03:56.800 --> 00:03:59.200
 will ask me for a password prompt and I

74
00:03:59.200 --> 00:04:00.200
 will specify the password.

75
00:04:01.100 --> 00:04:05.500
And you can see a high successfully logged in into the machine now. Let

76
00:04:04.500 --> 00:04:07.400
 us do one thing. Let's try to

77
00:04:07.400 --> 00:04:08.500
 change the port number.

78
00:04:09.300 --> 00:04:12.500
This is basically your configuration which is done many

79
00:04:12.500 --> 00:04:15.000
 times spices admins wherein they do not

80
00:04:15.300 --> 00:04:18.400
 want some random persons to try to do

81
00:04:18.400 --> 00:04:19.700
 SSH login.

82
00:04:20.400 --> 00:04:23.100
That is the main reason they most of

83
00:04:23.100 --> 00:04:26.900
 the times change the port numbers of these services

84
00:04:26.900 --> 00:04:29.500
 like SSH so by default no

85
00:04:29.500 --> 00:04:32.400
 other random people are trying to Brute Force

86
00:04:32.400 --> 00:04:33.600
 the SSH logins.

87
00:04:34.500 --> 00:04:37.500
So, let's see how to change the port number. It is

88
00:04:37.500 --> 00:04:40.700
 through the SSH configuration file. So Nano

89
00:04:40.700 --> 00:04:43.800
 slash Etc slash SSH slash

90
00:04:43.800 --> 00:04:46.500
 sshdconfig and

91
00:04:46.500 --> 00:04:49.600
 here you can see I have modified the port number

92
00:04:49.600 --> 00:04:53.500
 and I have written it as Port 69 and

93
00:04:52.500 --> 00:04:55.700
 I'm just going to save the file. Now. Remember

94
00:04:55.700 --> 00:04:58.500
 once you have modified the configuration file

95
00:04:58.500 --> 00:05:01.600
 you need to restart the SSH service.

96
00:05:02.300 --> 00:05:06.000
For which the command is surface SSH restart?

97
00:05:06.800 --> 00:05:10.200
Once we do that our SSH changes

98
00:05:09.200 --> 00:05:12.900
 gets replicated into the system. Now, let's

99
00:05:12.900 --> 00:05:15.100
 quickly see the status of the

100
00:05:15.100 --> 00:05:18.500
 service if it is running fine and our changes

101
00:05:18.500 --> 00:05:21.400
 have been modified or reflected or known. So

102
00:05:21.400 --> 00:05:24.900
 let us just confirm that the SSH server

103
00:05:24.900 --> 00:05:27.500
 has started on Port 69 or

104
00:05:27.500 --> 00:05:29.800
 no, or is it still running on 22?

105
00:05:30.500 --> 00:05:33.100
So just hit status and you can see it is

106
00:05:33.100 --> 00:05:36.600
 active running and the new port number is 69 as

107
00:05:36.600 --> 00:05:39.500
 we can see over here. Perfect now our

108
00:05:39.500 --> 00:05:42.200
 SSH server has configured correctly on

109
00:05:42.200 --> 00:05:45.200
 our new Port. So now let's try to log in again.

110
00:05:45.800 --> 00:05:48.100
But this time when we try to log in

111
00:05:48.100 --> 00:05:51.600
 into the port 22, you can see we get a error

112
00:05:51.600 --> 00:05:54.500
 which says connection refused because we know that

113
00:05:54.500 --> 00:05:57.400
 SSH is not running on the default

114
00:05:57.400 --> 00:06:00.400
 Port which is 22 now does it

115
00:06:00.400 --> 00:06:03.900
 says connection refuse the port is not accepting

116
00:06:03.900 --> 00:06:06.300
 any connections and we know that we

117
00:06:06.300 --> 00:06:09.400
 have just now modified the port number

118
00:06:09.400 --> 00:06:12.900
 and the new port number is six nine. So let

119
00:06:12.900 --> 00:06:15.300
 us try to connect on to our new Port that is

120
00:06:15.300 --> 00:06:19.000
 69 and hit enter and you can see it immediately

121
00:06:18.500 --> 00:06:22.000
 gave a prompt to give the password when

122
00:06:21.500 --> 00:06:24.300
 the user gives the right password. He is able

123
00:06:24.300 --> 00:06:27.200
 to successfully log in and you can see who am I

124
00:06:27.200 --> 00:06:30.200
 say is the user which is currently logged in

125
00:06:30.200 --> 00:06:31.100
 is admin.

126
00:06:31.700 --> 00:06:34.100
So I hope you guys understood how you can

127
00:06:34.100 --> 00:06:37.200
 do SSH to the host. You can

128
00:06:37.200 --> 00:06:40.300
 do SSH using the second method that was

129
00:06:40.300 --> 00:06:43.200
 using the name of the host and the Third

130
00:06:43.200 --> 00:06:46.400
 Way was using the port number in case the

131
00:06:46.400 --> 00:06:49.400
 SSH service is not running on the default

132
00:06:49.400 --> 00:06:51.900
 Port. I hope you guys understood. Thank you.
