Free RHCE Network Services and Security Questions and Answers — Questions and Answers
Question 1: What is the Samba directive that limits access to systems on the example.org network?
- hosts allow .example.org (Correct answer)
- allow_hosts example.org
- hosts_access example.org
- network_allow example.org
Correct answer: hosts allow .example.org
In Samba's `smb.conf` configuration file, the `hosts allow` directive is used to specify which hosts or networks are permitted to connect to a Samba share. By using `.example.org`, it allows any host within the `example.org` domain to access the share. This provides a flexible and effective way to control network access based on hostnames or IP addresses.
Question 2: How do you log in to a remote host using smbclient?
- smbauth //localhost/shared -U user01
- smblogin //remotehost/shared -U user01
- smbclient //localhost/shared -U user01%pass (Correct answer)
- smbconnect //remotehost/shared -U user01%pass
Correct answer: smbclient //localhost/shared -U user01%pass
The `smbclient` utility is used to access Samba shares from the command line. The correct syntax involves specifying the share path as `//hostname/sharename` and providing the username and password using the `-U user%password` format. This allows for direct authentication and interaction with the shared resource, similar to an FTP client.
Question 3: What is the SELinux file type appropriate for shared Samba directories?
- smb_dir_t
- samba_share_t (Correct answer)
- shared_samba_t
- samba_dir_share
Correct answer: samba_share_t
For SELinux to permit Samba to share directories, those directories must be assigned the correct SELinux file context. The `samba_share_t` type is specifically designated for directories intended to be shared via Samba. Applying this context ensures that SELinux allows the Samba daemon to read and write to these directories, preventing access denied errors.
Question 4: What is the relevant SELinux boolean associated with the sharing of home directories on Samba?
- samba_share_home
- samba_enable_home_dirs (Correct answer)
- selinux_share_home
- enable_samba_home_dirs
Correct answer: samba_enable_home_dirs
SELinux uses booleans to control specific system behaviors and permissions. To allow Samba to share users' home directories, the `samba_enable_home_dirs` boolean must be enabled. This boolean grants Samba the necessary permissions to access and serve content from user home directories, which are typically restricted by default for security reasons.
Question 5: What command enables the SELinux boolean for anonymous FTP uploads?
- enable_selinux_ftpd_anon_write
- sebool -a allow_ftpd_anon_write on
- setsebool -P allow_ftp_write_anon on
- setsebool -P allow_ftpd_anon_write on (Correct answer)
Correct answer: setsebool -P allow_ftpd_anon_write on
The `setsebool` command is used to modify SELinux boolean values, which control specific security policies. To enable anonymous FTP uploads, the `allow_ftpd_anon_write` boolean needs to be set to `on`. The `-P` flag makes this change persistent across system reboots, ensuring the setting remains active.
Question 6: How do you encrypt an existing file using Ansible Vault?
- ansible-vault lock secret.yml
- ansible-encrypt -f secret.yml
- ansible-vault encrypt secret.yml (Correct answer)
- ansible-vault secure secret.yml
Correct answer: ansible-vault encrypt secret.yml
Ansible Vault is a feature used to encrypt sensitive data within Ansible playbooks and files. The `ansible-vault encrypt secret.yml` command is the correct way to encrypt an existing file named `secret.yml`. This command will prompt for a vault password and then encrypt the file's contents, making it unreadable without the correct password.
Question 7: Which Ansible module is used to configure network settings?
- net
- network
- ifconfig
- nmcli (Correct answer)
Correct answer: nmcli
In Red Hat-based systems, the `nmcli` (NetworkManager Command Line Interface) module is the standard Ansible module for configuring network settings. It interacts with NetworkManager to manage network interfaces, connections, and other network-related parameters. This module provides a robust and consistent way to automate network configurations.
What is the Samba directive that limits access to systems on the example.org network?