Configure NFS, Samba, Automount Flashcards

1
Q

Main steps on server side to set up NFS

A

Start NFS service
Create dir to share
Edit /etc/exports to allow access to NFS share

sudo yum install nfs-utils nfslock rpcbind

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Detailed steps on server side for NFS

A

mkdir /data

vim /etc/exports:
/data *(rw,no_root_squash)
or
/data Teminal1(rw,no_root_squash)
*-all PC-s
on Server pc edit /etc/hosts:
Terminal1 1.2.3.4

systemctl enable nfs-server
systemctl start nfs-server

firewall-cmd –add-service nfs –permanent
firewall-cmd –add-service mountd –permanent
firewall-cmd –add-service rpc-bind –permanent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Detailed steps on client side for NFS

A

on server side:
vim /etc/exports:
/data *(rw,no_root_squash)

on client side:
showmount -e server_ip

mkdir /my_share
mount server_ip:/data /my_share

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Make NFS share persistent on client side

A

vim /etc/fstab:
1.2.3.4:/data /nfs nfs _netdev 0 0
mount -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Main steps on server side to set up Samba

A
  1. Install Samba server package
  2. Create dir to share
  3. Create local Linux user
  4. Set Linux permissions
  5. Use smbpasswd -a
    to add Samba user account
    This commands creates a Windows compatible user and this user is required because you cannot authenticate with your Windows credentials against a Linux user account.
  6. Enable share in /etc/samba/smb.conf
  7. Run systemctl start smd
  8. Run firewall-cmd –add-service samba –permanent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Detailed steps on server side to set up samba

A
  1. yum install -y samba
  2. mkdir /samba
  3. useradd -m samba
  4. chown samba:samba /samba
  5. chmod 770 /samba
  6. smbpasswd -a samba
    enter password for samba user
  7. vim /etc/samba/smb.conf
    [samba]
    comment = samba share
    path = /samba
    writeable = Yes
    read only = No
  8. systemctl enable –now smb
  9. systemctl enable –now nmb
  10. firewall-cmd –add-service samba –permanent
  11. firewall-cmd –reload
    frewall-cmd –list-all
  12. semanage fcontext -a -t samba_share_t /samba
  13. restorecon -R -v /samba
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Main steps on client side to set up Samba

A
  1. Install cifs-utils and samba-client
  2. Run smbclient -L //sambahost to discover shares
  3. mount -o username=sambauser //sambaserver/share /local_dir
  4. /etc/fstab
    //1.2.3.4/samba /local_dir cifs _netdev,username=,password= 0 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Detailed steps on client side to set up samba

A
1. yum groups install "Network File System Client"
or yum install samba-client cifs-utils
2. smbclient -L //1.2.3.4 -U samba
3. useradd -u 1000 -g 1000 samba
4. passwd samba 
5. mkdir /share
6. mount -o username=samba,uid=1000,gid=1000 //1.2.3.4/samba /share
or vim /etc/fstab
//1.2.3.4/samba /share cifs _netdev,username=samba,password=123,uid=1000,gid=1000
mount -a 
7. su - samba
8. cd /share; touch file1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Automount

A
  1. /etc/auto.master
    in this file the dir defined that automount should manage
    example, /data /etc/auto.data
    /data -dir to manage
    /etc/auto.data -file contains specs for /data dir
  2. /etc/auto.data - set subdir on which to mount and what to mount
    example of content,
    subdir2 -rw nfsserver:/data/subdir2
  3. systemctl enable –now autofs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Detailed steps for automount set up

A
  1. yum install autofs
  2. systemctl enable –now autofs
  3. vim /etc/auto.master
    add
    /sharedir /etc/auto.sharedir
  4. create vim /etc/auto.sharedir
    add
    data -rw srv:/data
    (absolute path will be /sharedir/data)
  5. systemctl restart autofs
  6. ls / =>
    dir sharedir
    cd /sharedir
    cd /data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly