File Sharing Flashcards

Samba, NFS and FTP

1
Q

Samba got its name from the SMB protocol, what does SMB SMB stand for?

A

Server Message Block

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

Which 3 Daemon services does Samba use?

A

smbd - Samba Daemon
nmbd - Netbios Daemon
winbind - Manages connections between Linux & Windows

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

What are the 5 Samba package names on Debian based distros?

A
cifs-utils - utilities to manage shares
samba - server function
samba-common - configs and docs
smbclient - client connections
winbind - winbind functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 5 Samba package names on Redhat based distros?

A
cifs-utils - utilities to manage shares
samba - server function
samba-common - configs and docs
samba-client - client connections
samba-winbind - winbind functions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where is the samba documentation installed?

A

/usr/share/doc/samba* or

/usr/share/doc/samba-version

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

Where does Samba store the storage/DB files?

A

/var/lib/samba

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

Where does Samba write log messages?

A

/var/log/samba

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

Where is the main samba config file?

A

/etc/samba/smb.conf

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

Samba utility that mounts samba shares

A

mount.cifs

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

Samba utility that can be used to administer a samba server and remote servers

A

net

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

Samba utility that can lookup netbios info

A

nmblookup

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

Samba utility that is used to manage samba user databases

A

pdbedit

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

Samba utility that executes remote procedure call functions

A

rpcclient

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

Samba utility that displays or modifies Samba access control functions

A

smbcacs

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

Samba utility that connects, list shares or provides ftp like access to a share

A

smbclient

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

Samba utility that manages the smbd daemon

A

smbcontrol

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

Samba utility that mounts samba shares - an older tool that has been replaced by mount.cifs

A

smbmount

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

Samba utility that manages the samba smbpasswd or tdbsam database

A

smbpaswd

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

Samba utility that sends files to a samba printer share

A

smbspool

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

Samba utility that displays the status of the samba server connections

A

smbstatus

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

Samba utility that createss samba file sare backups

A

smbtar

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

Samba utility that tests the syntax of the sm.conf file

A

testparm

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

Samba utility that displays winbindd info

A

wbinfo

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

Samba utility that is used to configure Samba as an active directory domain controller

A

samba-tool

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

Samba directive that defines the workgroup name

A

workgroup

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

Samba directive that declares a comment describing the samba server

A

server string

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

Samba directive that defines a netbios name for the Samba server (typically only required on legacy windows networks)

A

netbios name

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

Samba directive that defines a Kerberos realm

A

realm

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

Samba directive that defines which interface(s) to provide the Samba service

A

interfaces

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

Samba directive that defines systems that are allowed to access the Samba service

A

hosts allow

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

Samba directive that defines systems that should be denied access to the Samba services

A

hosts deny

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

Samba directive that stops the nmbd daemon from launching

A

disable netbios

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

Samba directive that defines which port numbers to listen on

A

smb ports

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

Samba directive that defines enables wins support on a netbios network

A

wins support

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

Samba directive that defines the Samba log file

A

log file

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

Samba directive that defines the logging level

A

log level

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

Samba directive that defines the maximum Samba log size

A

max log size

0 = no limit

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

Samba directive that defines the security mode of the server (ads, domain, server,share or user)

A

security

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

Samba directive that defines the account database (ldapsam, smbpasswd or tdbsam)

A

passdb backend

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

Samba directive that defines if encryption is allowed or required

A

smb encrypt

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for all shares?

A

[global]

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for a new share called LPIC-Share?

A

[LPIC-Share]

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for user home directories?

A

[homes]

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for a Samba server acting as a domain Controller? (A samba server that is responding to security authentication requests.

A

[netlogin]

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for printer shares?

A

[printers]

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

Samba file section names are enclosed in square brackets [ ]. Which file section name sets the directives for roaming user profiles?

A

[profiles]

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

Samba configuration file directive that describes the samba share

A

comment

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

Samba configuration file directive that determines if the Samba share is listed as an available share

A

browseable

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

Samba configuration file directive that declares a list of authorised users for a share

A

valid users

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

Samba configuration file directive that declares a list of unauthorised users for a share

A

invalid users

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

Samba configuration file directive that declares the absolute directory for a share

A

path

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

Samba configuration file directive that defines whether a password will be required for a share or not.

A

public

public = no #password required

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

Samba configuration file directive that allows only guest connections to a share

A

guest only

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

Samba configuration file directive that sets a group name for users connecting to a share

A

group

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

Samba configuration file directive that defines whether a share is writable or not

A

writable

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

Samba configuration file directive that declares a list or users and/or groups that can write to a share

A

write list

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

Samba utility that tests thesmb.conf file for errors. You should run this after every edit of smb.conf.

A

testparm

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

What does this command do?

pdbedit -L

A

pdbedit is used to manage backend user databases. The -L option will list the users in the database.

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

User John has access to a Samba server (192.168.20.10) on his network. How can John check which shares are available on the server?

A

Use the smbclient command.

smbclient -L //192.168.20.10 -U John

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

Samba will use DNS, which port does DNS use?

A

53

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

Which port numbers does the Samba Netbios feature use?

A

137 - 139
137 - Netbios Name service
138 - Netbios datagram service
139 - Netbios session service

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

Which port does Samba use for end point resolution?

A

135

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

Which port is used for SMB over TCP?

A

445

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

User John has access to a Samba server (192.168.20.10) on his network. How can John access a shared named public and use ftp like commands while connected to the share?

A

use smbclient

smbclient //192.168.20.10/public -U John

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

User John has access to a Samba server (192.168.20.10) on his network. How can John access a shared named public as if it were a local directory?

A

John need to mount the share.
Create a mount point : mkdir /mnt/public
then mount the share: mount -t cifs -o username=John,noperm //192.168.20.10/public /mnt/public

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

The SMB protocol has two security levels what are they?

A

user level security and
share level security

share level doesn’t use usernames, just passwords to access a share - it is now deprecated.

user level - users authenticate with a username and a password.

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

Samba has 5 modes, what are they?

A

ads - Allows Samba server to join active Directory as a member
domain - User names and passwords are authenticated by the domain controller.
server - Usernames and passwords handled by remote (possibly Samba) server
share - only password used to access share
user - username and password handled by this Samba server

68
Q

How would you setup Samba as an Active Directory member?

A

1 Install Samba and utilities
2 If domain controller is providing DNS, change resolv.conf
3 Setup NTP
4 Check domain controller name to IP resolution is correct - modify /etc/hosts if required
5 Modify smb,conf as required
6 Join the domain (e.g. net ads join -U Admin-user
7 Change nsswitch.conf to use winbind
8 Start the winbind service

69
Q

How would you make all printers defined in /etc/cups/printers available via samba? hint: you’ll need 6 directives…

A
[printers]
comment = All Printers on Server X
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
70
Q

User John has access to a Samba server (192.168.20.10) on his network which has a printer share “HP-Laserjet” availbale. How can John send his lpic-notes.txt file to the printer?

A

with the smbclient tool…

smbclient //192.168.20.10/HP-Laserjet -U John -c “print lpic-notes.txt”

71
Q

Name 8 things you can do to troubleshoot Samba

A
1 run testparm
2 Check the Service is started and running
3 Check share with smbclient -L
4 Check the workgroup setting
5 Do some network diagnostics, ping, traceroute...
6 Review log files increase debug level
7 check smbstatus (if installed)
8 Review user/group settings
72
Q

How can you break the log file into separate files for each client.

A

using the log file directive in smb.conf:

log file = /var/log/samba/log.%m

73
Q

How can you increase and decrease the Samba log level on the fly?

A

Increase:
kill SIGUSR1 smbd-PID
Decrease
kill SIGUSR2 smbd-PID

  • Where smbd-PID is the process ID of the smbd service.
74
Q

What are the Samba Log levels high and low settings?

A

log level = 0 #off
log level = 1 #low
log level - 10 # highest

75
Q

Which Samba utility command will display the netbios name for server 192.168.20.10?

A

nmblookup -A 192.168.20.10

76
Q

Which Samba utility command will display the netbios name and hostname for server 192.168.20.10?

A

nmblookup -S 192.168.20.10

77
Q

Which Samba utility command would you run to check if a user is in the local samba user database?

A

pdbedit -L or

pdbedit -L -u username

78
Q

Which Samba utility command would you run to check if a user on a Samba server that is a member of an Active directory?

A

wbinfo -u (for user info)

wbinfo -g (for group info)

79
Q

Which NFS Version supports UDP only, is 32 bit and has limited maximum file sizes and performance issues?

A

NFSv2, released in 1989, should avoid v2 now if possible.

80
Q

Which NFS Version utilises “weak cache” to change files in memory, uses multiple ports including TCP and uses NVM Network Lock Manager to help prevent issues?

A

NFSv3, released in 1995, v3 is the version tested on the LPIC exam.

81
Q

Which NFS Version introduces Kerberos Authentication,, consolidates multi-ports to a single port and features built-in file lcoking, better performance and security?

A

NFSv4, released in 2000 and refreshed in 2015.

82
Q

What is RPC?

A

Remote Procedure Call protocol. It allows programs to be ignorant of network details but still request services from another system.

83
Q

The filesystem an NFS server offers is called either an…

A

export or a share

84
Q

NFS daemon or kernel service that maps user and group ids?

A

idmapd (alias rpc.idmapd) - based on settings in idmapd.conf - not used in NFSv3 and lower.

85
Q

NFS daemon or kernel service that starts the NLM protocol service

A

locks (alias rpc.lockd) - not used in NFSv4

86
Q

NFS daemon or kernel service that handles NFS client mount requests on te NFS server side

A

mountd (alias rpc.mountd)

87
Q

NFS daemon or kernel service that handles user level NFS file access and data streaming

A

nfsd (alias rpc.nfsd) not used/required in NFSv4

88
Q

NFS daemon or kernel service that maps RPC services to port - need to be running on both client and server

A

portmapper (rpcbind)

89
Q

NFS daemon or kernel service that manages NFS quotas

A

rquotad (alias rpc.rquotad)

90
Q

NFS daemon or kernel service that provides NSM (Network Status Monitor and is used with lockd to provide NLM file locking

A

statd (alias rpc.statd)

91
Q

Which directory is the NFS documentation typically installed in?

A

/usr/share/doc/nfs*/

92
Q

NFS packages for Redhat based distros

A

nfs-utils
nfs-utils-lib
rpcbind
portmap

93
Q

NFS Packages for Debian based distros

A

nfs-kernel-server
nfs-common
rpcbind
portmap

94
Q

NFS - Main Export file also known as server export table

A

/etc/exports

95
Q

NFS - Directory with extra config files (files with .exports extension)

A

/etc/exports.d/

96
Q

NFS - mount config file used on NFS clients

A

/etc/nfsmount.conf

97
Q

NFS - primary nfs config files (for both Redhat and Debian based distros)

A

/etc/sysconfig/nfs
/etc/default/nfs-kernel-server
/etc/default/nfs-common

98
Q

NFS file that contains current exports and clients using them - maintained by the kernel

A

/proc/fs/nfs/exports

99
Q

NFS file that contains current exports and clients using them - not maintained by the kernel

A

/var/lib/nfs/xtab

100
Q

NFS file that contains a list of current exports for client systems - on the server only

A

/var/lib/nfs/etab

101
Q

NFS file tat contains a list of current exports and the client systems that currently have them mounted

A

/var/lib/nfs/rmtab

102
Q

NFS export directive that ensures clients can’t write to the share

A

ro

read-only

103
Q

NFS export directive that ensures clients can write to a share

A

rw

read-write

104
Q

NFS export directive that doesn’t check the write cache has been written to disk before reading data

A

async

105
Q

NFS export directive that checks the buffer has been written to disk before reading data

A

sync

106
Q

NFS export directive that treats ALL users as anonymous

A

all_squash

107
Q

NFS export directive that maps client root accounts to unprivileged accounts

A

root_squash

108
Q

NFS export directive that allows client root users to access export as root

A

no_root_squash

109
Q

NFS export directive that identifies filesystem export by UUID

A

fsid

110
Q

NFS export directive that assigns a specified GID to anonymous group clients

A

anongid

111
Q

NFS export directive that assigns a specified UID to anonymous user clients

A

anonuid

112
Q

NFS export directive that enables subtree checking so permissions are checked on higher level directories

A

subtree_check

113
Q

NFS export directive that ensures permission on higher level directories arenot checked

A

No_subtree_check

114
Q

NFS utility that manages and displays information concerning shares

A

exportfs

115
Q

NFS utility that mounts a NFS export on a NFS client

A

mount.nfs

116
Q

NFS utility that displays client per mount stats

A

mountstats

e.g.
mountstats /path/to/mounted/nfsshare

117
Q

NFS utility that displays client per mount IO stats

A

nfsiostat

118
Q

NFS utility that displays NFs client and server activity stats

A

nfsstats

119
Q

NFS utility that displays rpc service information

A

rpcinfo

120
Q

NFS utility that displays NFS server information, can be used remotely

A

showmount

121
Q

NFS utility that unmounts an NFS export

A

umount.nfs

122
Q

What command would you run to display a list of all registered RPC programs

A

rpcinfo -p

123
Q

exportfs command to export all shares

A

exportfs -a

124
Q

exportfs command to unexport all shares

A

exportfs -u

125
Q

exportfs command to ignore /etc/exports and use the command line

A

exportfs -i

126
Q

exportfs command to export share with command line options

A

exportfs -o

127
Q

exportfs command to refresh shares in /etc/exports

A

exportfs -r
or
exportfs -ra

128
Q

exportfs command to provide verbose info

A

exportfs -v

129
Q

what is this doing?

exportfs 192.168.20.10:/srv/nfsshare1

A

Exporting the share “nfsshare1” on the server 192.168.20.10

130
Q

How can you display NFS shares with all the associated options (ro,rw,sync,async etc..)

A

exportfs -v for localhost or
or
exportfs -v 192.168.20.10 or

cat /var/lib/nfs/etab

131
Q

What does an nfs mount definition look like in fstab? force use of version 3.

A

192.168.20.10:/srv/nfsshare1 /mnt/nfsshare1 nfs intr,nfsvers=3,tcp 0 0

132
Q

What are the two built in methods of security in NFS

A

user level share options in /etc/exports and

AUTH_SYS or AUTH_UNIX uid and gid file permissions

133
Q

What 6 things can we do to improve NFSv3 security?

A

1 Use TCP (UDP is easier to spoof)
2 Limit wildcard use in export definitions
3 Use root_squash
4 consider all_squash
5 Manage access to ports
6 Use TCP wrappers (hosts.allow and hosts.deny)

134
Q

What can we do to troubleshoot NFS issues?

A

1 Check /etc/exports
2 Verify Daemons are running
3 Review NFS ports
4 Check server exports (exportfs -v showmount -e)
5 Basic network diagnostics (ping, traceroute…)
6 Review log file (/var/log/messages |grep nfs)
7 check available exports on the server: showmount -e [server]
9 check NFS export option exportfs -v

135
Q

Which ports are used in FTP passive mode

A

Ports 20 and 21

136
Q

Which ports are used in FTP active mode

A

unknown, these ports a negotiated between the client and server when establishing the connection

137
Q

Name the 3 ftp servers mentioned on the LPIC exam

A

vsftpd
pure-FTPd
proFTPD

138
Q

There are 2 command linux command line ftp clients, what are they?

A

ftp - standard basic ftp client

lftp - refined ftp client

139
Q

vsftpd package name

A

vsftpd

sudo apt-get install vsftpd

140
Q

vsftpd document location

A

/usr/share/doc/vsftpd-version or

/usr/share/doc/vsftpd

141
Q

vsftpd config file location

A

/etc/vsftpd.conf or

/etc/vsftpd/vsftpd.conf

142
Q

vsftpd config directive to allow anonymous users to create directories

A

anon_mkdir_write_enable

Default - No

143
Q

vsftpd config directive to permit anonymous users to rename and delete files

A

anon_other_write_enable

Default - No

144
Q

vsftpd config directive to specify the directory an anonymous user changes into on login

A

anon_root

Default - Directory in /etc/passwd for FTP user

145
Q

vsftpd config directive to allow anonymous users to see and download world readable file

A

anon_world_readable_only

Default - Yes

146
Q

vsftpd config directive to allow anonymous users to upload files

A

anon_upload_enable

Default - No

147
Q

vsftpd config directive to allow anonymous user access to the FTP server

A

anonymous_enable

Default - Yes

148
Q

vsftpd config directive to change ownership of anonymous users uploaded files

A

chown_uploads
Default - No
Define username with chown_username

149
Q

vsftpd config directive to change the owner of all anonymously uploaded files

A

chown_username

enable with chown_uploads, set username with chown_username

150
Q

vsftpd config directive to chroot local users

A

chroot_local_user

Default - No

151
Q

vsftpd config directive to define a list of users to be placed in chroot

A

chroot_list_enable

chroot_list_file

152
Q

vsftpd config directive to set the default ftp account

A

ftp_username

Default - ftp

153
Q

vsftpd config directive to run in either standalone mod or via initialisation service

A

listen

listen_ipv6

154
Q

vsftpd config directive to allow local users to login via ftp

A

local_enable

Default - No

155
Q

vsftpd config directive to log all ftp queries

A

log_ftp_protocol

Default - No

156
Q

vsftpd config directive to check a file for a list of valid/invalid users

A

userlist_enable

userlist_file

157
Q

vsftpd config directive to allow ftp users access to commands that modify the filesystem

A

write_enable

Default - No

158
Q

How would you check if the vsftpd service supports tcp wrappers

A

Get the full path
which fsftpd
then check if the binary uses the libwrap library
ldd /usr/sbin/vsftpd |grep libwrap

159
Q

How would you install pure-ftpd in Debian and Redhat?

A
Debian:
apt-get install pure-ftpd
Redhat
check epel repo is enabled
yum -enablerep=epel  info pure-ftpd
yum -enablerep=epel  install pure-ftpd
160
Q

pure-ftpd command line option to listen only for ipv4

A
  • 4

- -ipv4only

161
Q

pure-ftpd command line option to listen for only ipv6

A
  • 6

- -ipv6only

162
Q

pure-ftpd command line option to chroot all users

A
  • A

- -chrooteveryone

163
Q

pure-ftpd command line option to set the max number of client connections

A
  • c

- -maxclientsnumber

164
Q

pure-ftpd command line option to set the max number of clients per IP

A
  • C

- -macclientsperip

165
Q

pure-ftpd command line option to allow anonymous users

A
  • e

- -anonymously

166
Q

pure-ftpd command line option to disallow anonymous users

A
  • E

- -noanonymous

167
Q

pure-ftpd command line option to start the service in the background.

A
  • B

- -daemonize