+ All Categories
Home > Documents > CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration

Date post: 18-Feb-2016
Category:
Upload: corina
View: 31 times
Download: 0 times
Share this document with a friend
Description:
CIT 470: Advanced Network and System Administration. Accounts and Namespaces . Topics. Namespaces Policies: selection, lifetime, scope, security User Accounts Directories LDAP. Namespaces. A namespace consists of A set of unique keys A set of attributes associated with each key Example - PowerPoint PPT Presentation
47
CIT 470: Advanced Network and System Administration Slide #1 CIT 470: Advanced Network and System Administration Accounts and Namespaces
Transcript
Page 1: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #1

CIT 470: Advanced Network and System Administration

Accounts and Namespaces

Page 2: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #2

Topics

1. Namespaces2. Policies: selection, lifetime, scope, security3. User Accounts4. Directories5. LDAP

Page 3: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #3

NamespacesA namespace consists of

– A set of unique keys– A set of attributes associated with each key

Example– Key = Username– Attributes

• GECOS• Homedir• Shell• Password

Page 4: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #4

Namespaces

Systems include many namespacesUser account names.E-mail addresses.Filesystem pathnames.Hostnames.IP addresses.Printer names.Service names.

Page 5: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #5

Types of Namespaces

FlatNo duplicates may exist.Ex: usernames in /etc/passwd.

HierarchicalTree-structured namespace like DNS.Duplicates can exist.Ex: www.nku.edu and www.google.com

Page 6: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #6

Namespace Problems

1. How to select names?2. How to avoid name collisions?3. How to ensure consistency?4. How to distribute names?

Page 7: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #7

Name SelectionFunctional Names

mail hostname, /cit/470, student accountDescriptive names

geographic, print type, customer typeFormula-based Names

cvg0141 hostname, student0148 account Themed Names

constellations (orion, ursa, etc.)No Standard

Page 8: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #8

Name Lifetime

When are names removed?Immediately after PC, user leaves org.Set time after resource is no longer in use.

When are names re-used?Immediately: functional names.Never.After a set time: usernames, email addresses.

Page 9: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #9

Namespace ScopeGeographical scopes

– Local machine. (e.g., /etc/passwd.)– Local network.– Organization.– Global (e.g., DNS.)

Service scopes– Single username for UNIX, NT, RADIUS, e-mail, VPN?

Transferring scopes– Difficult without advance planning.– Some names may have to change.

Page 10: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #10

Namespace Security

1. What are you trying to protect names from and why?

2. Do the names need to be protected or just the attributes?

3. Who can add, change, or delete records?4. Can the owner of a record change fields

within the record?

Page 11: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #11

Example Namespace: Usernames

Selection policies– Descriptive: waldenj, jwalden– Decriptive + formulaic: waldenj1, jwalden0002

Scope– Use for every campus (avoids collisions.)– Use for every service (avoids collisions.)

Lifetime– Do not reuse until 1 year has passed since email

addresses derive from usernames.

Page 12: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #12

One Big DatabaseCentralize namespace in one big database.

– Use SQL or LDAP to store entire namespace.Derive other namespaces from database.

– Program to generate UNIX accounts.– Program to generate NT accounts.– etc.

Advantages– Consistency– Ease of making changes, additions, deletions.

Page 13: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #13

User Account Types

OS files– UNIX /etc/{passwd,shadow}– Windows SAM

Network service– NIS– LDAP– Kerberos– Active Directory– RADIUS

Page 14: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #14

UNIX Accounts• Account Components

– Username– UID– Password– Home directory

• Account Files– /etc/passwd– /etc/shadow– /etc/group

• Account Management– Adding users– Removing and disabling users– Account/password policies

Page 15: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #15

/etc/{passwd,shadow}

/etc/passwd– Username– UID– Default GID– GCOS– Home directory– Login shell

/etc/shadow– Username– Encrypted password– Date of last pw change.– Days ‘til change allowed.– Days `til change required.– Expiration warning time.– Expiration date.

Central file(s) describing UNIX user accounts.

student:x:1000:1000:Example User,,555-1212,:/home/student:/bin/bashstudent:$1$w/UuKtLF$otSSvXtSN/xJzUOGFElNz0:13226:0:99999:7:::

Page 16: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #16

Username

Syntax– Each username must be unique.– Length limits (8 chars on old systems)– Any character except : or \n.

• Issues– Naming standards.– How to ensure that usernames are unique?– System uses UIDs internally.

Page 17: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #17

UIDs• UIDs are 32-bit non-negative integers.• Standards

– Root is UID 0.– System accounts have low UIDs (<= 500)

• Uniqueness– Multiple usernames can have same UID!– Re-using UIDs may give away files to new user.– Distributed systems may require unique UIDs

across organizational boundaries.

Page 18: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #18

Password

Syntax– Length: unlimited (MD5,SHA1), 8 chars (crypt)– Chars: anything except \n, though certain control

chars may be interpreted by system.

Stored in “encrypted” format.– Hashed: crypt, MD5, SHA1– Salted: 12-bit salt means 4096 different hashes

for each password

Page 19: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #19

GID• GIDs are 32-bit non-negative integers.• Each user has a default GID.

– File group ownership set to default GID.– Temporarily change default GID: newgrp.

• Groups are described in /etc/group– Users may belong to multiple groups.– Format: group name, pw, GID, user list.– wheel:x:10:root,waldenj,bergs

Page 20: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #20

GECOS

Original use– Data for General Electric Comprehensive OS

Current use– User information.– Full name, location, phone number, e-mail.

Page 21: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #21

Home Directory• User’s CWD at login time.• Typically where user stores all files.

Page 22: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #22

Login Shell• Process started when user logs in.• Typically a shell like bash, tcsh, ksh, or zsh.

– System users may be different.– Disabled accounts have a noshell program.

Page 23: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #23

Adding a User

1. Create account with adduser.2. Lock account until user arrives.3. User signs account agreement.4. Set passwd with passwd.

Page 24: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #24

Adding a User1. Edit /etc/{passwd,shadow} with vipw.2. Set passwd with passwd command.3. Edit /etc/group to add groups.4. Create user home directory.

1. mkdir /home/studenta2. chown studenta.student /home/studenta3. chmod 755 /home/studenta

5. Copy default files from /etc/skel.bashrc, .Xdefaults, .xsession, etc.

6. Set e-mail aliases, disk quotas, etc.7. Verify that the account works.

Page 25: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #25

Disabling an Account• Edit account configuration:

– Place * in front of encrypted password.– Replace shell with nologin program.

• Kill active logins and processes.

Page 26: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #26

Removing a User1. Disable account.2. Change shared passwords (root, etc.)3. Kill active logins and processes.4. Remove from local databases/files.5. Remove from e-mail aliases.6. Remove mail spool (backup first.)7. Remove crontabs and pending jobs.8. Remove temporary files.9. Remove home directory (backup first.)10. Remove from passwd, shadow, and group.

Page 27: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #27

What is a Directory?

Directory: A collection of information that is primarily searched and read, rarely modified.

Directory Service: Provides access to directory information.

Directory Server: Application that provides a directory service.

Page 28: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #28

Directories vs. Databases

Directories are optimized for reading.– Databases balanced for read and write.

Directories are tree-structured.– Databases typically have relational structure.

Directories are usually replicated.– Databases can be replicated too.

Both are extensible data storage systems.Both have advanced search capabilities.

Page 29: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #29

System Administration Directories

Types of directory data– Accounts– Mail aliases and lists (address book)– Cryptographic keys– IP addresses– Hostnames– Printers

Common directory services– DNS, LDAP, NIS

Page 30: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #30

Advantages of Directories

Make administration easier.– Change data only once: people, accounts, hosts.

Unify access to network resources.– Single sign on.– Single place for users to search (address book)

Improve data management– Improve consistency (one location vs many)– Secure data through only one server.

Page 31: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #31

NIS: Network Information Service

Originally called Sun Yellow Pages– Clients run ypbind– Servers run ypserv– Data stored under /var/yp on server.

Server shares NIS maps with clients– Each UNIX file may provide multiple maps– passwd: passwd.byname, passwd.byuid

Slave servers replicate master server content.Easy to use, but insecure, difficult to extend.

Page 32: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #32

LDAPLightweight Directory Access Protocol

– Lightweight compared to X.500 directories.– Directory, not a database, service.– Access Protocol, not a directory itself.

Page 33: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #33

LDAP Clients and ServersLDAP Clients

– Standalone directory browsers.– Embedded clients (mail clients, logins, etc.)– Cfg /etc/nsswitch.conf on UNIX to use LDAP.

Common LDAP servers– OpenLDAP– Fedora Directory Server (formerly Sun, Netscape)– Mac Open Directory– Microsoft ActiveDirectory– Novell eDirectory (NDS)

Page 34: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #34

LDAP StructureAn LDAP directory is made of entries.

– Entries may be employee records, hosts, etc.Each entries consists of attributes.

– Attributes can be names, phone numbers, etc.– objectClass attribute identifies entry type.

Each attribute is a type / value pair.– Type is a label for the information stored (name)– Value is value for the attribute in this entry.– Attributes can be multi-valued.

Page 35: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #35

Tree-structure of LDAP Directories

Page 36: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #36

LDAP SchemasSchemas specify allowed objectClasses and attributes.

Page 37: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #37

LDIF

LDAP Interchange Format.– Standard text format for storing LDAP

configuration data and directory contents.

LDIF Files– Collection of entries separated by blank lines.– Mapping of attribute names to values.

Uses– Import new data into directory.– Export directory to LDIF files for backups.

Page 38: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #38

LDIF Output Example

Page 39: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #39

Distinguished NamesDistinguished Names (DNs)

– Uniquely identify an LDAP entry.– Provides path from LDAP root to the named entry.– Similar to an absolute pathname.– dn:cn=Jeff Foo,ou=Sales,dc=plainjoe,dc=org

Relative DNs (RDNs)– Any unique attribute pair in directory’s container.– ex: cn=Jeff Foo OR username=fooj– Similar to a relative pathname.– Except may have multiple components.– cn=Jane Smith+ou=Sales– cn=Jane Smith+ou=Engineering

Page 40: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #40

LDAP Client/Server Interaction

1. Client requests to bind to server.2. Server accepts/denies bind request.3. Client sends search request.4. Server returns zero or more dir entries.5. Server sends result code with any errors.6. Client sends an unbind request.7. Server sends result code and closes socket.

Page 41: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #41

LDAP Operations

Client Session Operations– Bind, unbind, and abandon

Query and Retrieval Operations– Search and compare

Modification Operations– Add, modify, modifyRDN, and delete

Page 42: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #42

AuthenticationAnonymous Authentication

Binds with empty DN and password.Simple Authentication

Binds with DN and password. Cleartext.Simple Authentication over SSL/TLS

Use SSL to encrypt simple authentication.Simple Authentication and Security Layer

SASL is an extensible security scheme.SASL mechanisms: Kerberos, GSSAPI, SKEY

Page 43: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #43

Distributed Directories• Use multiple LDAP servers.• Why distribute?

– Throughput• More servers can reduce load on any single server.

– Latency• Have local server serve local data to LAN.• Only use WAN for non-local data on other servers.

– Administrative Boundaries• Let each side administrate their own directory.

Page 44: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #44

OpenLDAPOpen source LDAPv3 server.

– LDAP server: slapd– Client commands: ldapadd, ldapsearch– Backend storage: BerkeleyDB– Backend commands: slapadd, slapcat– Schemas: /etc/openldap/schema– Data: /var/lib/ldap

Configuration files– Client: /etc/openldap/ldap.conf– Server: /etc/openldap/slapd.conf

Page 45: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #45

Building an OpenLDAP Server1. Install OpenLDAP.2. Configure LDAP for your domain.

Change suffix, rootdn, rootpw options.vim /etc/openldap/slapd.conf

3. Start serverImmediate: /sbin/service ldap startPermanent: /sbin/chkconfig --level 35 ldap on

4. Add data with ldapadd5. Verify functionality with ldapsearch

Page 46: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #46

LDAP Authentication1. Configure server with schema + user data.2. Point clients to hostname and rootDN of svr.

/etc/ldap.conf and /etc/openldap/ldap.conf

3. Verify server access with ldapsearch4. Configure clients to use LDAP auth

/etc/nsswitch.confpasswd: files ldap shadow: files ldap group: files ldap

Page 47: CIT 470: Advanced Network and System Administration

CIT 470: Advanced Network and System Administration Slide #47

References1. Brian Arkills, LDAP Directories Explained: An Introduction and

Analysis, Addison-Wesley, 2003.2. Gerald Carter, LDAP System Administration, O’Reilly, 2003.3. J. Heiss, “Replacing NIS with Kerberos and LDAP,”

http://www.ofb.net/~jheiss/krbldap/, 2004.4. LDAP Howtos, Links, and Whitepapers, http://www.bind9.net/ldap/,

2005.5. http://www.ldapman.org/, 2005.6. Luiz Malere, “Linux LDAP HOWTO,”

http://www.tldp.org/HOWTO/LDAP-HOWTO/, 2004.7. OpenLDAP, OpenLDAP Administrator’s Guide,

http://www.openldap.org/devel/admin/, 2005.8. RedHat, Red Hat Enterprise Linux 4 Reference Guide, Chapter 13,

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/, 2005.


Recommended