Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

Chapter 7 Configuring Networking 233

Features

The Force user option forces all connections that are made to the service to be made with this user name. This still requires the user to connect with a valid user name and password, but after they connect, they will be seen by the system as the forced user. Force group name does the same thing with a group account. The Don’t Descend feature is used to show directories that are not empty as empty. Take the /proc directory for example; if you don’t want users to nose around this directory, you can list it as Don’t Descend and it will appear empty to clients. The Guest account option provides the default account used for public access areas. The Max connections option is used to limit the maximum number of connections to the system at one time. If this number is zero then an unlimited number of connections are possible.

At this point, you have completed a basic configuration of Samba and you have acquired a basic knowledge of the SMB/CIFS system. Although network administrators usually configure and maintain Samba servers, the ability to work with Samba is a valuable skill.

Configuring Client Services

3.5 Configure basic client services (e.g., X client, SMB/CIFS, NIS, NFS) 3.15 Configure access rights (e.g., rlogin NIS, FTP, TFTP, SSH, Telnet)

When configuring a client, you need to configure the services that the client may use. This includes the X client, SMB/CIFS, NIS, and NFS. These services are selected during installation, but you may need to perform some of the configurations after installation.

The X client was configured in Chapters 4, 5, and 6. For more information, use the X Configuration sections in those chapters.

SMB/CIFS

The SMB/CIFS client is part of the Samba suite and can be selected during installation. This package can also be added to a system by using one of the methods discussed in Chapter 5. The SMB/CIFS client can access an SMB/CIFS/CIFS server. It offers an interface similar to that of the ftp program. The SMB/CIFS client command launches the client Table 7-2 lists the switches needed for connection. The switches are listed in order of use from closest to the command to furthest from the command; the table also includes a description of the switch for the SMB/CIFS client software.

234 Part III Configuration

Table 7-2

SMB/CIFS Client Switches

Switch

Description

Example

 

 

 

servicename

The service that you want to use on the

//server/service

 

server in the format of a NetBIOS name.

 

 

 

 

password

The password required to access the

users password

 

specified service on the specified server.

 

 

 

 

-b

This option changes the transmit/send

-b 1500

 

buffer size when getting or putting a file

 

 

from/to the server. The default is

 

 

65520 bytes.

 

 

 

 

-d

The higher this value, the more detail

-d 1

 

will be logged to the log files about the

 

 

activities of the client, ranging from 0-10

 

 

and A.

 

 

 

 

-D

Change to initial directory before starting.

-D /tmp

 

 

 

-U

Sets the SMB/CIFS username or

-U user[%password]

 

username, often includes [%pass] to

 

 

include the password.

 

 

 

 

-W

Overrides the default workgroup specified

-W usergroup

 

in the workgroup parameter of the

 

 

SMB/CIFS.conf file for this connection.

 

 

 

 

-M

This option sends messages to another

cat message.txt | SMB/CIFS

 

computer by using the “WinPopup”

client -M user

 

protocol.

 

 

 

 

-A

This option allows you to specify a file

-A filename

 

from which to read the username and

 

 

password used in the connection.

 

 

 

 

-N

Suppresses the normal prompt

-N

 

for password.

 

 

 

 

-l

Specifies a base file name into which

-l logfilename

 

operational data from the running

 

 

client will be logged.

 

 

 

 

-L

Lists services available on a server.

-L host

 

 

 

-I

IP address is the address of the server to

-I 10.0.0.250

 

connect to. Often used with –L.

 

 

 

 

Chapter 7 Configuring Networking 235

Switch

Description

Example

 

 

 

-E

Causes the client to write messages to

-E

 

the standard error stream (stderr) rather

 

 

than to the standard output stream.

 

 

 

 

-c

A command string separated by

 

semicolons to be executed instead of

 

prompting from stdin. -N is implied by -c.

-c command string such as -c ‘print -’

-i

This specifies a NetBIOS scope that

-i scope

 

SMB/CIFS client will use to communicate

 

 

when generating NetBIOS names.

 

 

 

 

-O

TCP socket options to set on the client

-O socket options

 

socket. The SMB/CIFS.conf MAN page

 

 

lists the valid options.

 

 

 

 

-p

This number is the TCP port number that

-p port

 

will be used when making connections to

 

 

the server instead of the standard TCP port.

 

 

 

 

-R

Name resolution order with the options

-R lmhosts

 

of “lmhosts,” “host,” “wins,” and “bcast”.

 

 

 

 

-s

Provides the location of the

-s SMB/CIFS .conf

 

SMB/CIFS.conf file.

 

 

 

 

-T

The SMB/CIFS client may be used to

//server/share “”

 

create tar compatible backups of all the

-N -Tc backup.tar *

 

files on an SMB/CIFS /CIFS share.

 

 

 

 

Know the switches but also the format for all commands used in Linux.

These switches from Table 7-3 are used to create the connection. After the connection is complete, the user is presented with a new prompt that looks like this:

SMB/CIFS :\>

This prompt indicates that the client is ready and waiting to carry out a user command. The user commands are shown in Table 7-3.

236 Part III Configuration

Table 7-3

SMB/CIFS Client Commands

Command

Description

Example

 

 

 

?

Used to provide information about

? [command]

 

a command.

 

 

 

 

!

The ! command will execute a shell

! [shell command]

 

locally and run the specified shell

 

 

command.

 

 

 

 

cd

Used to change directories, or if no

cd [directory name]

 

directory is requested, it will list the

 

 

current directory.

 

 

 

 

del

The client will request that the server

del <mask>

 

attempt to delete all files matching

 

 

“mask” in the current directory.

 

 

 

 

dir

A list of the files matching “mask” in

dir <mask>

 

the current directory will be retrieved

 

 

and displayed.

 

 

 

 

exit

Exit the program SMB/CIFS client; this

exit

 

will terminate all connections.

 

 

 

 

get

Get a remote file <name> and copy it

get <remote file name>

 

to the local file [name]. This is a binary

[local file name]

 

transfer.

 

 

 

 

help

Used to provide information about a

help [command]

 

command.

 

 

 

 

lcd

The current working directory on the

lcd [directory name]

 

local machine will be changed to the

 

 

directory specified.

 

 

 

 

lowercase

When lowercasing is toggled ON, local

lowercase

 

filenames are converted to lowercase

 

 

when using the get and mget commands.

 

 

 

 

ls

A list of the files matching “mask” in

ls <mask>

 

the current directory will be retrieved

 

 

and displayed.

 

 

 

 

mask

This command allows the user to set up

mask <mask>

 

a mask, which will be used during

 

 

recursive operation of the mget and

 

 

mput commands.

 

 

 

 

md

Used to create a new directory with

md <directory name>

 

a specified name.

 

 

 

 

Chapter 7 Configuring Networking 237

Command

Description

Example

 

 

 

mget

Copy all files matching mask from the

mget <mask>

 

server to the machine running the client.

 

 

 

 

mkdir

Used to create a new directory with a

mkdir <directory name>

 

specified name.

 

 

 

 

mput

Copy all files matching mask from the

mput <mask>

 

machine running the client to the server.

 

 

 

 

print

Print the specified file from the client

print <file name>

 

through a printable service on the server.

 

 

 

 

printmode

Set the print mode to suit either binary

printmode <graphics

 

data or text.

or text>

 

 

 

prompt

Toggle prompting for filenames during

prompt

 

operation of the mget and mput

 

 

commands.

 

 

 

 

put

Copy the file called “local file name”

put <local file name>

 

from the client to the server with

[remote file name]

 

optional “remote file name.”

 

 

 

 

queue

Displays the print queue, showing the

queue

 

job ID, name, size, and current status.

 

 

 

 

quit

Exit the program SMB/CIFS client; this

quit

 

will terminate all connections.

 

 

 

 

rd

Remove the specified directory.

rd <directory name>

 

 

 

recurse

Toggle directory recursion for the

recurse

 

commands mget and mput.

 

 

 

 

rm

Remove all files in the current directory

rm <mask>

 

with the match the <mask>.

 

 

 

 

rmdir

Remove the specified directory.

rmdir <directory name>

 

 

 

tar

Perform the tar operation.

tar <c|x>[IXbgNa]

 

 

 

blocksize

Must be followed by a valid

blocksize <blocksize>

 

(greater than zero) blocksize.

 

 

Causes tar file to be written out

 

 

in blocksize*TBLOCK (usually 512

 

 

byte) blocks.

 

 

 

 

tarmode

Changes tar’s behavior with regard

tarmode

 

to archive bits.

<full|inc|reset|noreset>

 

 

 

setmode

A version of the DOS attrib command

setmode <filename>

 

to set file permissions.

<perm=[+|\-]rsha>

 

 

 

Соседние файлы в предмете Операционные системы