2016年3月29日 星期二

samba server 架設2016/3/30

今天我們所上的課程是samba server的架設一開始當然是要安裝samba的套件才能使用啦~~
    
安裝指令:#yum -y install samba
      設定想分享的目錄 :#mkdir /sharedpath

設定SELinux限定規則:
      #semanage fcontext -a -t samba_share_t '/sharedpath(/.*)?'            
      #restorecon -RFvv /sharedpath

設定samba server的設定檔:
#vim /etc/samba/smb.conf
 [global]
   workgroup = WORKGROUP
   interfaces = lo eth0 192.168.1.1/24
   hosts allow = 127. 192.168.1.
  [myshare]
  path = /sharedpath
  writable = no
  valid users = fred, @management

開啟 SELinux 存取規則: #setsebool -P samba_enable_home_dirs=on
                                          #restorecon -RFvv /sharedpat
在 Samba Server 上,検查設定項目是否正確: #testparm
在 Samba Server 上,新增一般的使用者帳號與密碼:
#useradd -s /sbin/nologin fred
在 Samba Server 上,安裝管理使用者的套件:
#yum -y install samba-client
在 Samba Server 上,設定可存取 Samba Server的使用者帳號與密碼:
#smbpasswd -a fred
啟動 Samba Server:
#systemctl start smb nmb
#systemctl enable smb nmb
在 Samba Server 上,開啟防火牆設定:
#firewall-cmd --permanent --add-service=samba
#firewall-cmd --reload
在 client 端,掛載 Samba Server 所分享目錄:
#mkdir /mnt/myshare
#mount -t cifs -o username=fred //server/myshare /mnt/myshare

linux FTP及NFS站台架設 2016/3/29

今天我們教了linux 的站台架設,一開始我們現要安裝ftp及nfs的套件

nfs套件安裝指令:  #yum -y install nfs-utils  

接下來就是啟動nfs: #systemctl start nfs-server.service
                       #systemctl enable nfs-server.service

防火牆的開啟: #firewall-cmd --permanent --add-service=nfs
                #firewall-cmd --reload

建立根目錄: #mkdir /myshare

設定分享目錄的權限:#vim /etc/exports/myshare  *.example.com(rw) 10.0.0.0/8(ro)

在 NFS Server 上,發佈分享目錄:#exportfs -r

在 NFS Server 上,啟動 SELiux 放行規定: #setsebool -P nfs_export_all_rw on
                                                                            #setsebool -P nfs_export_all_ro on

在 NFS Server 上,查詢分享狀態:#showmount -e

在 client 端,掛載 NFS Server 所分享目錄: #mkdir /mnt/nfsshare
                                      #mount -t nfs server(ps:請打自己的本機ip位置):/myshare /mnt/nfsshare

參考文獻資料:http://linux.onlinedoc.tw/search/label/Server%3A%3ANFS%20Server

2016年3月14日 星期一

職訓局課程

第一次上纪老師的課,他教的是linux ftp站台架設,雖然才上第一次課,不過課程還蠻有樂趣的~~