-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathANS LAB 3 COMMANDS.txt
60 lines (57 loc) · 2.63 KB
/
ANS LAB 3 COMMANDS.txt
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
ANS LAB 3 COMMANDS
1. NFS
1.1. sudo firewall-cmd --permanent --add-service=nfs
sudo firewall-cmd --permanent --add-service=mountd
sudo firewall-cmd --permanent --add-service=rpc-bind
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
1.2. sudo dnf update
sudo dnf install -y nfs-utils
sudo mkdir -p /mnt/nfs_share
sudo chmod 777 /mnt/nfs_share
echo "/mnt/nfs_share *(rw,sync,no_root_squash,no_subtree_check)" | sudo tee -a /etc/exports
sudo exportfs -rav
sudo systemctl restart nfs-server
sudo systemctl enable nfs-server
1.3. sudo firewall-cmd --add-port=2049/tcp --permanent
sudo firewall-cmd --add-port=111/tcp --permanent
sudo firewall-cmd --add-port=111/udp --permanent
sudo firewall-cmd --reload
1.4. -Client:
dnf update
dnf install nfs-utils nfs4-acl-tools
showmount -e 10.10.16.185
mkdir -p /mnt/backups
mkdir –p /mnt/share
mount -t nfs 10.10.16.185 :/mnt/nfs_share /mnt/share
mount | grep nfs
1.5. -Server:
echo "Test File 1" | sudo tee /nfs/shared/test1.txt
echo "Test File 2" | sudo tee /nfs/shared/test2.txt
-Client:
ls /mnt/nfs_shared
cat /mnt/nfs_shared/test1.txt
1.6. -Server:
sudo mkdir -p /mnt/nfs_lab3_A_read /mnt/nfs_lab3_A_write
sudo mount 10.10.16.99:/mnt/nfs_lab3_A_read /mnt/nfs_lab3_A_read
sudo mount 10.10.16.99:/mnt/nfs_lab3_A_write /mnt/nfs_lab3_A_write
cat /mnt/nfs_lab3_A_read/flag.txt
echo "Marko Ivanovski" | sudo tee /mnt/nfs_lab3_A_write/226089.txt
Ако треба автоматски да се монтираат директориумите при стартување, додајте ги во '/etc/fstab' на клиентот: 10.10.16.185:/nfs/shared /mnt/nfs_shared nfs defaults 0 0
2. FTP
1.1. sudo dnf install -y vsftpd
sudo cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
1.2. sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --permanent --add-port=30000-31000/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
1.3. sudo adduser 226089
sudo mkdir -p /home/226089/ftp
sudo chown root:root /home/226089/ftp
sudo chmod 555 /home/226089/ftp
1.4. sudo mkdir -p /home/226089/ftp/upload
sudo chown 226089:226089 /home/226089/ftp/upload
echo "Marko Ivanovski" | sudo tee /home/226089/ftp/upload/MarkoIvanovski.txt
sudo chown 226089:226089 /home/226089/ftp/upload/MarkoIvanovski.txt
1.5. sudo systemctl restart vsftpd
sudo systemctl enable vsftpd