System Administration Practice Homework2 - File System Server

Slides:



Advertisements
Similar presentations
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
Advertisements

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.
George Blank University Lecturer. Creating A Web Site at NJIT Professor Blank.
Using FileZilla to FTP CS10001 – Computer Literacy Kent State University.
Guide To UNIX Using Linux Third Edition
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 14: Problem Recovery.
Linux Operations and Administration
2440: 141 Web Site Administration Remote Web Server Access Tools Instructor: Enoch E. Damson.
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
SSH Keys William Stearns
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.
System Administration HW2 - FTP, Samba, BT, ZFS jwbai.
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.
VsFTP in Linux. Introduction to FTP The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the.
Home Media Network Hard Drive Training for Update to 2.0 By Erik Collett Revised for Firmware Update.
Unix Basics Chapter 4.
VNC Greg Fankhanel Jessica Nunn Jennifer Romero. What is it? Stands for Virtual Network Computing It is remote control software which allows you to view.
LING 408/508: Programming for Linguists Lecture 3 August 31 st.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Day 11 SAMBA NFS Logs Managing Users. SAMBA Implements the ability for a Linux machine to communicate with and act like a Windows file server. –Implements.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
AE6382 Secure Shell Usually referred to as ssh, the name refers to both a program and a protocol. The program ssh is one of the most useful networking.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Usage of Workstation Lecturer: Yu-Hao( 陳郁豪 ) Date:
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
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.
System Administration HW2 - File System Server ylin.
System Administration HW2 - File System Server. Computer Center, CS, NCTU 2 FTP  Install a FTP server for FreeBSD Pure-FTPd: /usr/ports/ftp/pure-ftpd.
CCNA2 Chapter 2 Cisco IOS Software. Cisco’s operating system is called Cisco Internetwork Operating System (IOS) IOS provides the following network services:
Basic Service & Settings xclin. Computer Center, CS, NCTU 2 If you want to transfer a file…
Linux Operations and Administration
System Administration Practice Homework6 - LDAP login + Puppet + Jail yench / lctseng / chchang2222.
VIRTUAL HOSTING WITH PureFTPd And MYSQL (Quota And Bandwidth Management) BY Odoh Kenneth Emeka Sun Yu Patrick Appiah.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
Integrity Check As You Well Know, It Is A Violation Of Academic Integrity To Fake The Results On Any.
File Transfer Protocol (FTP) CIS 130. File Transfer Protocol (FTP) Copy files from one internet host (server) to your account on another host –Need domain.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
Integrity Check As You Well Know, It Is A Violation Of Academic Integrity To Fake The Results On Any.
System Administration Practice Homework 1-3 : Chinese World lctseng.
SSH. 2 SSH – Secure Shell SSH is a cryptographic protocol – Implemented in software originally for remote login applications – One most popular software.
Using Linux Kaya Oğuz Room: 310.
CS1010: Intro Workshop.
Introduction to Operating Systems
Network Administration Practice Homework4 – Mail System
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
Homework 3 frank.
Port Forwarding and Shell Login Essentials
FTP Lecture supp.
Chapter 11: Managing Users
File Transfer Protocol
Part 3 – Remote Connection, File Transfer, Remote Environments
System Administration Practice Homework 1-1 : FreeBSD Base
Web Server Administration
Assignment Preliminaries
Services & Settings.
Lab 1 introduction, debrief
Intro to UNIX System and Homework 1
Telnet/SSH Connecting to Hosts Internet Technology.
Chapter 27: System Security
Web Programming Essentials:
lctseng / Liang-Chi Tseng
System Administration HW1-3 Chinese World
Final Project– NFS and NIS
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Computer System Administration Homework 3 – File Server
System Administration HW3 - File System Server
System Administration HW2 - File System Server
Services & Settings lctseng.
Presentation transcript:

System Administration Practice Homework2 - File System Server lctseng / yench / chchang2222

FTP (1) Install a FTP server for FreeBSD Pure-FTPd: /usr/ports/ftp/pure-ftpd Compile it with “upload script” support (from port)

FTP (2) Settings (total 25%) Anonymous Login Can download from /home/ftp/for_all Can upload & mkdir from /home/ftp/anonymous Can’t delete from /home/ftp/anonymous Can only download the files which owner isn’t “ftp” Hidden directory /home/ftp/private There is a directory called “flag” inside Client can’t list in /home/ftp/private/ but can in private/flags

FTP (3) Settings (cont’d) Create a virtual user “ftp-god” Chrooted (/home/ftp is your root directory) Password is your student-id Full access to /home/ftp Read/write to ftp root directory/private/for_all/anonymous Private directory is visible to ftp-god Create a system user “sysgod” Could login by ssh Password is your student id Permission is same as ftp-god Your ftp server should support FTP over TLS All accounts are chrooted (/home/ftp is the root directory)

FTP (4) Grading Anonymous login (total 10%, 2% for each) Download from “for_all” Upload to “anonymous” Can’t delete from “anonymous” Can only download the files which owner isn’t “ftp” Hidden directory “private” problem: enter without listing ftp-god (total 5%) (3%) Full access for “/home/ftp”, “for_all”, “anonymous” (2%) Full access for “private” (read, write) Sysgod (total 5%) (3%) Login from ssh (1%) Full access for “/home/ftp”, “for_all”, “anonymous” (1%) Full access for “private” (read, write) TLS connection (ftpes) (5%)

FTP – Hints (1) Lots of README Accounts related: /usr/local/share/doc/pure-ftpd/* Accounts related: pure-pw(8) pure-pwconvert(8) README.Virtual-Users

FTP – Hints (2) How to setup demo environment Within VM, using notebook/remote desktop Don’t need to open GUI for VM (console) Just need putty and Filezilla Use host-only network interface, connect from host OS host-only network interface: create connection between host and VM Within VM, no remote desktop Using public IP Active mode from npbsd0~4 (ftp -A -P 8021 140.113.X.Y) Port forwarding for your VM (related to your firewall) Real Machine If you have public IP, use bridge mode is better for VM

RC (1) Write some rc scripts to start daemons when booting Upload script for pure-ftpd A program executed when files are uploaded pure-uploadscript(8) store pure-ftpd upload filename sh pure-uploadscript execute

RC (2) Record uploaded filenames Your task Write a rc script called “sa_upload” under /usr/local/etc/rc.d

RC (3) RC script can be used to start the pure-uploadscript program Instead of executing that program manually This rc script requires “sa_upload_enabled="YES"” in /etc/rc.conf Just like a daemon start-up script

RC (4) Kill pure-uploadscript using rc script This requires a pid file to indicate which process to stop You need this to write the stopping function

RC (5) Prepare for upload script Enable upload script under pure-ftpd.conf CallUploadScript yes Create a simple upload script and rename it to /root/sa_upload_process Don’t forget to chmod a+x sa_upload_process Script content is provided below: (copy info file and rename it) After starting pure-ftpd, you need to start sa_upload so that you can upload files #!/bin/sh echo "upload:$1" >> /var/log/sa_ftp_log

RC (6) External authenticate for pure-ftpd You can write your own program to check password pure-authd(8) README.Authentication-Modules Login information pure-ftpd Account & password pure--authd Authentication result External program

RC (7) In this homework, there is special account ‘alibaba’ Not a system nor a virtual user account Login with password “opensesame” Go into /tmp Other password Go into /home/ftp

RC (8) Same as previous, you need to write a rc script under /usr/local/etc/rc.d Enabled by sa_auth_enabled="YES" in /etc/rc.conf Controlled by service sa_auth start/stop The authentication script is placed in /root/ftp-auth-handler

RC (9) Prepare for external authentication Enable upload script under pure-ftpd.conf ExtAuth /var/run/ftpd.sock Create a simple upload script and rename it to /root/ftp-auth-handler Don’t forget to chmod a+x ftp-auth-handler Script content is provided below: (copy info file and rename it) #!/bin/sh if [ "$AUTHD_ACCOUNT" = "alibaba" ]; then echo 'auth_ok:1' echo 'uid:65534' echo 'gid:65534' if [ "$AUTHD_PASSWORD" = "opensesame" ]; then echo 'dir:/tmp' else echo 'dir:/home/ftp' fi echo 'auth_ok:0' echo 'end'

RC (10) Requirement Control the upload script daemon with service sa_upload start/stop Control the external auth daemon with service sa_auth start/stop Can record filenames into /var/log/sa_ftp_log Special user ‘alibaba’ can login with password ‘opensesame’, see different directory(/tmp), otherwise see /home/ftp pure-ftpd, pure-uploadscript and pure-authd should start automatically when booting

RC (11) Grading sa_upload (5%) Sa_auth (5%) (2%) Upload record functionality (can demo without rc script) rc script (2%) Controlled by service(8) (1%) Startup automatically Sa_auth (5%) (2%) External authentication functionality (can demo without rc script)

RC – Hints (1) For pure-uploadscript, you can manually start the daemon by following commands For pure-authd Before you write rc scripts, you can use these commands to check that whether you enable the upload-script/external-auth services pure-uploadscrip -B -r /root/sa_upload_process pure-authd -s /var/run/ftpd.sock -r /root/ftp-auth-handler -B

RC – Hints (2) How to write a rc start-up script: https://www.freebsd.org/doc/en/articles/rc-scripting/ You needs some shell script technique https://www.twbsd.org/cht/book/ch24.htm README.Virtual-Users http://download.pureftpd.org/pub/pure-ftpd/doc/README.Virtual-Users README.Authentication-Modules http://download.pureftpd.org/pub/pure-ftpd/doc/README.Authentication-Modules

Samba Install Samba Location You should create at least 4 accounts /usr/ports/net/samba4 Location Samba share /home/ftp/for_all to Windows (10%) Mount Windows directory at /home/ftp/windows(5%) You should create at least 4 accounts Admin (total 5%) Full access (read, download, delete, rename, mkdir, upload) to all files and directories Guest (total 5%) Can only list the files and directories (2%) Can’t perform (read, download, delete, rename, mkdir, upload) to all files and directories (3%)

Samba Test1 Test2 Common User (total 10%) Can (read, rename, delete, download) to Test1’s files (3%) Can mkdir (1%) Can upload files to Test1’s directory and root directory /home/ftp/for_all (1%) Can’t do (read, rename, delete, download) to other files and directories (5%) Test2 Can (read, download, delete, rename) to Test2’s files Can mkdir Can upload files to Test2’s directory and root directory /home/ftp/for_all Can’t do (read, download, delete, rename) to other files and directories

ZFS on /home/ftp Create a zfs file system with mirror (5%) Set compression (5%) Do zfs snapshot (5%) Do zfs rollback (5%) Automatic snapshot script (10%) Write a script such that whenever the script is invoked,   it will take a snapshot for the dataset; in addition, it will    only preserve the most recent 7 snapshots took by this script.  Automatic backup (5% bonus) Periodically backup a zfs dataset to google drive

Reminder Demo with root is not allowed Please use sudo /usr/ports/security/sudo File/directory permissions are important Owner, group, other Read, write, execute Set UID, set GID, sticky bit Setting port forwarding to allow your services to be accessible over the Internet

Deadline Demo sheet will be available next week Demo week: 10/26~10/30 More details about demo will be announced soon

Help! Newsgroup cs.course.sysadm BS2 board CS-SysAdmin CSCC (EC building 3F) ta@nasa.cs.nctu.edu.tw (For complex problems) IRC channel #nctuNASA (Recommend) passwd: ILoveCSCC Use screen or tmux to stay online, so TAs can tag you to answer your questions. Before you ask a question… 提問的智慧: How To Ask Questions The Smart Way http://mis.ndhu.edu.tw/docu/question.htm