forked from joseeden/KodeKloud_Engineer_Labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TASK_30-Install_a_package_-_vsftpd.sh
205 lines (118 loc) · 4.27 KB
/
TASK_30-Install_a_package_-_vsftpd.sh
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
-----------------------------------------------------------------------------------------------------------------
Start WAS NOT ABLE TO RECORD TIME
Finished
-----------------------------------------------------------------------------------------------------------------
TASK 30 - Install a package - vsftpd
# Note - the required package kept changing each time lab is restarted. While I've list down all the
# required steps here, the final attempt showed git and I find that much mroe easier to install so
# I just disregarded the list I prepared for vsftpd installaiton.
# Nevertheless, I still retain the documentation as this might be helpful in my furutre labs.
REQUIREMENTS:
As per new application requirements shared by the Nautilus project development team, serveral new packages need to be installed on all app servers in Stratos Datacenter. Most of them are completed except for vsftpd.
Therefore, install the vsftpd package on all app-servers.
-----------------------------------------------------------------------------------------------------------------
CONTENT:
I. REFERENCES
II. STEPS - SUMMARY
III. COMMANDS USED
IV. STEPS - BREAKDOWN
-----------------------------------------------------------------------------------------------------------------
I. REFERENCES
https://phoenixnap.com/kb/how-to-setup-ftp-server-install-vsftpd-centos-7
-----------------------------------------------------------------------------------------------------------------
II. STEPS - SUMMARY
-----------------------------------------------------------------------------------------------------------------
III. COMMANDS USED
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
thor ******
-----------------------------------------------------------------------------------------------------------------
IV. STEPS - BREAKDOWN
sudo yum update -y
sudo yum install vsftpd -y
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
sudo systemctl status vsftpd
sudo yum install firewalld -y
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo systemctl status firewalld
sudo firewall-cmd --zone=public --permanent --add-port=21/tcp
sudo firewall-cmd --zone=public --permanent --add-service=ftp
firewall-cmd -h | grep load
firewall-cmd –-reload
ls -l /etc/vsftpd/
sudo cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.default
ls -l /etc/vsftpd/
cd /etc/vsftpd/
cat vsftpd.conf | grep \
-e anonymous_enable \
-e local_enable \
-e write_enable \
-e chroot_local_user \
-e allow_writeable \
-e userlist_enable \
-e userlist_file \
-e userlist_deny
vi vsftpd.conf
# anonymous_enable=NO
# local_enable=YES
# write_enable=YES
# chroot_local_user=YES
# allow_writeable_chroot=YES
# userlist_enable=YES
# userlist_file=/etc/vsftpd/user_list
# userlist_deny=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO
ls -l /etc/vsftpd/
cat /etc/vsftpd/user_list
vi /etc/vsftpd/user_list
# add app server user
cat /etc/vsftpd/user_list
sudo systemctl restart vsftpd
sudo systemctl status vsftpd
sudo adduser testuser
sudo passwd testuser
# password - admin123
echo “testuser” | sudo tee –a /etc/vsftpd/user_list
cd /home/
sudo mkdir -p testuser/ftp/upload
sudo chmod 550 /home/testuser/ftp
sudo chmod 750 /home/testuser/ftp/upload
sudo chown –R testuser /home/testuser
sudo yum install ftp -y
ftp 172.16.238.10
ftp 172.16.238.11
ftp 172.16.238.12
ftp localhost
# from jumphost
ftp 172.16.238.10
ftp 172.16.238.11
ftp 172.16.238.12
-----------------------------------------------------------------------------------------------------------------