-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathsession-05.txt
More file actions
153 lines (114 loc) · 2.95 KB
/
Copy pathsession-05.txt
File metadata and controls
153 lines (114 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
:q -> quit
:q! -> force quit
:wq -> write quit
:/ -> search from top
:? search from bottom
:set nu -> display numbers
:noh -> no highlight
:<line-number>
:%d -> delete everything
:%s -> substituion
Esc Mode
=======
u -> undo
Ctrl+r -> redo
gg -> takes to top
Shift+g -> takes to bottom
yy -> copy
p -> paste
dd -> cut
shift+p -> paste above the line
useradd <user-name>
/etc/passwd
id user-name
/etc/group
usermod -g group-name user-name
usermod -aG group-name user-name
passwd user-name
/etc/ssh/sshd_config
sshd -t
/etc/sudoers
vimsudo -c
gpasswd -d <user-name> <group-name>
userdel
tar -xf *.tar.gz
tar -cf *.tar.gz folder_name
awk and cut commands
Permissions
============
- rw- r-- r--
User/owner group others
u g o
chmod o+w perm
either owner of the file or root user can only change access levels
R -> 4
W -> 2
X -> 1
chmod 764
Ownership
===========
chown <user>:<group>
ownership can only be changed by root user. not even owner of the file can change the ownership
employee joins organisation
==========================
1. He should generate keys
2. send public key to admins
3. admin creates .ssh folder inside user home directory
4. permission should be 700 for .ssh
5. ownershop should be user including group
6. create authorized_keys inside .ssh folder and paste public key in it
7. authorized_keys permission should be max 600
then user can login
ssh -i rahim rahim@3.85.244.109
add him to wheel group
/etc/sudoers
package management
=================
yum -> old rhel
dnf -> latest
apt-get or apt install
dnf install <package-name> -> redhat based instances
/etc/yum.repos.d/ -> all URLS are configured
he developed Linux kernel from the scratch using c language... he invented git also..
flavours or distributions
Redhat -> commands + apps -> Redhat flavour/distribution -> CentOs/fedora
Redhat family = redhat = centos = fedora = aws linux
Ubuntu
Oracle
Suse
IBM
1. community edition -> free
2. enterprise edition -> support redhat
dnf install <package-name>
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install fontconfig java-21-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload
Service Management
===================
0-65,535
https://facebook.com
ssh facebook.com
port 22 sshd service is running
1. get the facebook.com IP address
2. connect to the service running on port 443
Delhi -> Hyderabad
HYD pincode -> HYD central office
Street name ->
Apartment name ->
Flat number ->
systemctl start <service-name>
systemctl restart <service-name>
systemctl status <service-name>
systemctl enable <service-name> -> auto start
systemctl disable <service-name>
systemctl start wget
systemctl start curl
nginx -> http/web server -> port 80
systemctl status <service-name> -> check service is running or not
network management
=================
netstat -lntp -> check port is running or not and accessible to internet