 One functioning host depends on hundreds of configuration files › But groups of hosts in your network needs more !! › Think about you have tens of workstations/servers,

Slides:



Advertisements
Similar presentations
Chapter One The Essence of UNIX.
Advertisements

FILE TRANSFER PROTOCOL Short for File Transfer Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for transferring.
System Administration Final Project - Micro Computer Center hchung, hwchiu.
Chapter 21 Security. Computer Center, CS, NCTU 2 Firewall (1)  Using ipfw 1.Add these options in kernel configuration file and recompile the kernel 2.Edit.
NIS Consistent configuration across the network. Why NIS? Primary reason is to provide same user configuration across the network Users go any machine.
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
NIS – Network Information System WeeSan Lee
UNIX Chapter 00 A “ Quick Start ” into UNIX Operating System Mr. Mohammad Smirat.
Guide To UNIX Using Linux Third Edition
Chapter 18 Sharing System Files. Computer Center, CS, NCTU 2 Why share?  One functioning host depends on hundreds of configuration files But groups of.
CIT 470: Advanced Network and System Administration
UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.
A crash course in njit’s Afs
Linux System Administration LINUX SYSTEM ADMINISTRATION.
DHCP. DHCP (Dynamic Host Configuration Protocol) is a network service that enables clients to obtain network settings (IP Address, Subnet Mask, Default.
Lecture – Single Login NIS and Winbind. NIS Network Information Service (NIS) is the traditional directory service on UNIX platforms Still widely used.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
Mid 1960 ’ s - Multics - proposed by AT&T, Honeywell, GE & MIT; funded by DARPA Thompson & Ritchie create Unix 1978 to 84 - Bill Joy & Chuck Haley.
Chapter 10 Networking and the Internet ITSC 1458.
Final Project – NFS and NIS jwbai. Computer Center, CS, NCTU 2 Goal master.passwd passwd group netgroup amd.conf userA, /nis/home/userA userB, /nis/home/userB.
Setting up NIS and HTTP. Network Information Service Reading: 1. Linux NIS HOWTO: howto/HOWTOhttp://
ITI-481: Unix Administration Meeting 5. Today’s Agenda Network Information Service (NIS) The Cron Program Syslogd and Logging.
Extending Active Directory Authentication and Account Management To Solaris 10 Systems A HOWTO guide for joining a Solaris 10 (8/07) host to a domain in.
2/19/2003 Lecture 3 Computer System Administration Lecture 3 Setup (continued)
2002 Networking Operating Systems (CO32010) 1. Operating Systems 2. Processes and scheduling 3.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Linux+ Guide to Linux Certification, Second Edition Chapter 14 Network Configuration.
Inetd...Server of Servers Looks at a number of ports Determines when a service is needed on any of those ports Calls the appropriate server Restarts new.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Hour 7 The Application Layer 1. What Is the Application Layer? The Application layer is the top layer in TCP/IP's protocol suite Some of the components.
Centralized logins with NIS Eric Stolten Tim Meade Mark Sidnam.
New SA Training Topic 6: Service Management Our organization takes advantage of many service type to provide functionality to users and ease management.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Application Services COM211 Communications and Networks CDA College Theodoros Christophides
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Berkeley R Utilities & the new S Utilities The Unix (or Berkeley) r utilities provide an alternative to IP facilities telnet and ftp. Three programs: rlogin.
CIS 192B – Lesson 3 Network Information Services.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
Networking in Linux. ♦ Introduction A computer network is defined as a number of systems that are connected to each other and exchange information across.
1/14 Char 18 Sharing System Files Content –NIS(The Network Information Service) –NIS+
Exercise 4 – NFS and NIS Announced Date: 2007/12/11 Due Date: 2007/12/25.
1 Network Information System (NIS). 2 Module – Network Information System (NIS) ♦ Overview This module focuses on configuring and managing Network Information.
Linux Services Configuration
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
System Administration HW5 - Micro Computer Center yihshih / lctseng.
Linux Operations and Administration
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
1 CMPT 471 Networking II DNS © Janice Regan,
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 Security of NIS (YP) Gary Lam
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
PRESENTED BY ALI NASIR BITF13M040 AMMAR HAIDER BITF13M016 SHOIAB BAJWA BITF13M040 AKHTAR YOUNAS BITF13M019.
Chapter 17: Sharing System Files Stephen Workman.
NIS Concepts and Configuration
Chapter 27: System Security
Sharing System Files.
Final Project Announce: Due:
Final Project– NFS and NIS
Linux and TCP/IP Networking
Sharing System Files.
Sharing System Files.
System Administration HW5 - Micro Computer Center
System Administration HW5 - Mini Private Lab
Sharing System Files.
Sharing System Files.
Announced Date: 2006/12/20 Due Date: 2007/1/3
The Network File System
Network Information Service
Presentation transcript:

 One functioning host depends on hundreds of configuration files › But groups of hosts in your network needs more !! › Think about you have tens of workstations/servers, and each year, there are about 250 new students in CS department.  We need one server to rule them all!

FilenameFunction /etc/passwdUser account information /etc/groupUNIX group definitions /etc/hostsMaps between IP and hostname /etc/servicesWell-known network service port /etc/protocolsMaps text names to protocol numbers /etc/mail/aliases alias /etc/rpcLists ID numbers for RPC services /etc/printcapPrinter information /etc/termcapTerminal type information  Good candidates to share

 Keep a master copy of each configuration file in one place and distribute it › Push vs. Pull model › Copy files around  rdist  rsync  expect  Let each machine obtain its configuration file from a center server › NIS

 Advantage › Simple › Preserve owner, group, mode, and modification time of files  Control file › makefile like › distfile › How to distribute the files  [Usage] % rdist [-f distfile] [label]  [Format] label: pathnames -> destinations commands CommandDescription notify namelist Sends to namelist except pathlist Do not distribute files in pathlist except_pat patternlist Do not distribute files that matches patternlist Special [ pathlist ] “string” Execute an sh “ string ” command

 Example › $ rdist › $ rdist -f distfile › $ rdist -f distfile all SYS_FILES = (/etc/passwd /etc/group /etc/mail/aliases) GET_ALL = (bsd1 bsd2 linux1) GET_SOME = (csduty alumni) all: ${SYS_FILES} -> ${GET_ALL} notify special /etc/mail/aliases “/usr/bin/newaliases”; some: ${SYS_FILES} -> ${GET_SOME} except /etc/mail/aliases; except_pat /etc/passwd*; notify

 Disadvantage › Based on rsh  /.rhosts or /etc/hosts.equiv permit root access  rdist in FreeBSD › /usr/ports/net/rdist6 › Use more secure “ssh” to replace rsh  Use public-key cryptography to do identification  Encrypt entire rdist conversation  $ rdist - P /usr/local/bin/ssh – f myDistfile

 Write control scripts for interactive programs  Fundamental expect commands › spawn  Start up a subprocess to control › send  Feed input to subprocess › expect  Take action depending on a subprocess ’ s output  expect “ pattern ” {action}  timeout and eof are special patterns  Our tactic › Connect to server using ftp and pull down what we want

 example spawn /usr/bin/ftp netserver while 1 { expect { “Name*:”{send “netclient\r”} “Password:”{send “netclientpassword\r”} “ftp> ”{break} “failed”{send_user “Can’t login.\r”; exit 1} timeout{send_user “Timeout problem.\r”; exit 2} }} send “lcd /etc\r” expect “ftp> ” {send “cd pub/sysfiles\r”} expect “ftp> ” {send “get passwd\r”} expect “ftp> ” {send “quit\r”; send_user “\r”} exit 0

 NIS (YP – Yellow Page) › Release by SUN in 1980s › For master server  System files are kept in original locations and edited as before  There will be a server process takes care of availability of these files over the network › Data files are hashed and formed a database for lookup efficiency  ypmake  gdbm hashing library  Make + Makefile › NIS domain  The NIS server and it ’ s clients › Multiple NIS server  One master NIS server and multiple NIS slave servers

 /etc/netgroup › Group users, machines, nets for easy reference in other system files › Can be used in such as /etc/{passwd,group,exports}, /etc/exports › [format] groupname list-of-members › [member-format] (hostname, username, nisdomainname) › Example of /etc/netgroup adm_user(,chwong,) (,lwhsu,) adm_cc_cs(cshome,,) (csduty,,) (csmailgate,,) sun_cc_cs(sun1,,) (sun2,,) (sun3,,) bsd_cc_cs(bsd1,,) (bsd2,,) (bsd3,,) linux_cc_cs(linux1,,) (linux2,,) (linux3,,) all_cc_csadm_cc_cs sun_cc_cs bsd_cc_cs linux_cc_cs

 Prioritizing sources › System information can come from many resource  Local, NIS, … › Specify the sources that we are going to use and the order of them  /etc/{passwd, group} › +  Entire NIS map is included ›  Include only certain netgroup › +name  Include only a single  /etc/nsswitch.conf … passwd:files nisplus nis shadow:files nisplus nis group: files nisplus nis hosts: files nisplus nis dns …

 Use netgroup in other system files › Example for used in /etc/passwd › Example for used in /etc/exports … pop:*:68:6:Post Office Owner:/nonexistent:/sbin/nologin www:*:80:80:World Wide Web Owner:/nonexistent:/sbin/nologin nobody:*:65534:65534:Unprivileged user:/nonexistent:/sbin/nologin +:*:::::/usr/local/bin/cs.nologin /raid-alldirs –maproot=root mailgate ccserv backup /raid -alldirs –maproot=65534 –network –mask /home-ro –mapall=nobody –network –mask /usr/src /usr/obj –maproot=0 bsd_cc_csie

 Advantages of NIS › Not necessary for administrator to be aware of NIS internal data format › Cross-platform  Disadvantages of NIS › If a slave NIS server is down, the slave’s copy may not be updated  Periodically poll data › Not secure  Any host on a network can claim to be NIS Server  Any one can read your NIS maps › Consume network bandwidth

 NIS directory › /var/yp  NIS Server Map directory › In a subdirectory of the NIS directory named for the NIS domain  /var/yp/+csie.nis › Example: csduty:/var/yp -lwhsu- sudo ls +cs.nis/ auto.home group.byname netgroup.byuser protocols.bynumber auto.master hosts.byaddr netid.byname publickey.byname auto.net hosts.byname networks.byaddr rpc.byname auto.user mail.aliases networks.byname rpc.bynumber bootparams master.passwd.byname passwd.adjunct.byname services.byname ethers.byaddr master.passwd.byuid passwd.byname shadow.byname ethers.byname netgroup passwd.byuid sudoers.pwd.byname group.bygid netgroup.byhost protocols.byname ypservers1

 NIS master server  NIS slave servers › “ ypxfr ” pull command  Every NIS slave server runs ypxfr periodically › “ yppush ” push command  NIS master server use yppush to instruct each slave to execute ypxfr › ypservers special map  A list of all NIS slave servers in that NIS domain

 Example of CS cshome:/var/yp -lwhsu- sudo cat ypservers csduty.cs.nctu.edu.tw csmailgate.cs.nctu.edu.tw csmail.cs.nctu.edu.tw

 After all maps are ready › Request and response › ypserv daemons  Run on NIS servers  Waiting for NIS requests and answering them by looking up information in maps › ypbind daemons  Run on every machine in NIS domain  Locate a ypserv and return the identity to the C library, which then contact the server directly

 NIS commands and daemons ProgramDescription domainnameSet or print name of current NIS domain makedbm yp_mkdb (FreeBSD) Build hashed map ypinitConfigure a host as master or slave ypsetLet ypbind to bind a particular NIS server ypwhichFind out which yp server is using ypcatPrint the value contained in an NIS map yppasswdChange password on the NIS server ypchfnChange GECOS information on NIS server ypchshChange login shell on NIS server yppasswddServer daemon for yppasswd,ypchsh,ypchfn

 Steps › Sequence: Master Server  Slave Servers  each client  Master Server › Set nis domain name › Use ypinit to construct a list of slave servers › Run ypserv and rpc.yppasswdd daemons  Slave Servers › Set nis domain name › Use ypinit to set master NIS server › Get NIS maps  NIS client › Set nis domain name › Modify /etc/passwd, /etc/group › Run ypbind daemons

 Edit /etc/rc.conf › If your host does not want to be a NIS client, remove nis_client related entries › It is a good idea to force NIS master server to ypbind itself  $ man ypbind … # NIS nisdomainname="sysadm.nis" nis_server_enable="YES" nis_server_flags="" nis_client_enable="YES" nis_client_flags="-s -m -S sysadm.nis,sysadm" nis_yppasswdd_enable="YES" nis_yppasswdd_flags="" …

 Initializing the NIS Maps › NIS maps are generated from configuration files in /etc with exceptions: /etc/master.passwd, /etc/netgroup, /etc/passwd › $ cp /etc/master.passwd /var/yp/master.passwd › $ cp /etc/netgroup /var/yp/netgroup › Edit /var/yp/master.passwd, removing all system accounts (ex: root) › $ cd /var/yp › $ ypinit - m sysadm.nis › $ reboot  Rebuild yp maps whenever the configuration files are changed  Example › When you change /var/yp/master.passwd › $ cd /var/yp › $ make

 Makefile of NIS … YPSRCDIR = /etc YPDIR = /var/yp YPMAPDIR = $(YPDIR)/$(DOMAIN) ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd) BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd) HOSTS = $(YPSRCDIR)/hosts NETWORKS = $(YPSRCDIR)/networks PROTOCOLS = $(YPSRCDIR)/protocols RPC = $(YPSRCDIR)/rpc SERVICES = $(YPSRCDIR)/services SHELLS = $(YPSRCDIR)/shells GROUP = $(YPSRCDIR)/group ALIASES = $(YPSRCDIR)/mail/aliases NETGROUP = $(YPDIR)/netgroup PASSWD = $(YPDIR)/passwd MASTER = $(YPDIR)/master.passwd YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain PUBLICKEY = $(YPSRCDIR)/publickey NETID = $(YPSRCDIR)/netid AMDHOST = $(YPSRCDIR)/amd.map …

sysadm:/var/yp -lwhsu- ps auxww | grep yp root ?? Is 2:57PM 0:00.01 /usr/sbin/ypserv root ?? Is 2:57PM 0:00.00 /usr/sbin/ypbind -s -m -S sabsd.nis,sabsd root ?? Ss 2:57PM 0:00.00 /usr/sbin/rpc.yppasswdd sysadm:/var/yp -lwhsu- ypwhich sysadm.cs.nctu.edu.tw sysadm:/var/yp -lwhsu- ypcat -x Use "passwd" for "passwd.byname" Use "master.passwd" for "master.passwd.byname" Use "group" for "group.byname" Use "networks" for "networks.byaddr" Use "hosts" for "hosts.byaddr" Use "protocols" for "protocols.bynumber" Use "services" for "services.byname" Use "aliases" for "mail.aliases" Use "ethers" for "ethers.byname" sysadm:/var/yp -lwhsu- ypcat passwd lwhsu:*:1000:1000:lwhsu:/home/lwhsu:/bin/tcsh chwong:*:1001:1000:chwong:/home/chwong:/bin/tcsh sysadm:/var/yp -lwhsu- ypcat hosts sysadm.cs.nctu.edu.tw sysadm progexam.cs.nctu.edu.tw progexam

 NIS client configuration › Edit /etc/rc.conf › Edit /etc/master.passwd (using vipw) and /etc/group › reboot … # NIS nisdomainname="sysadm.nis" nis_client_enable="YES" nis_client_flags="-s" … nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin +:*:::::::: nobody:*:65534: +:*::