日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

服务管理-文件服务器

發(fā)布時(shí)間:2024/1/17 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 服务管理-文件服务器 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

FTP工作原理

FTP Transfer Protocol 傳輸協(xié)議的縮寫。

FTP會(huì)話包含了兩個(gè)通道,一個(gè)叫控制通道,一個(gè)叫數(shù)據(jù)通道。

控制通道:控制通道是和FTP服務(wù)器進(jìn)行溝通的通道,鏈接FTP,發(fā)送FTP指令都是通過(guò)控制通道來(lái)完成的。 數(shù)據(jù)通道:數(shù)據(jù)通道是和FTP服務(wù)器進(jìn)行文件傳輸或者列表的通道。

FTP協(xié)議中,控制連接均有客戶端發(fā)起,而數(shù)據(jù)鏈接有兩種方式:PORT方式和PASV方式

PORT模式(主動(dòng)方式)

PORT模式簡(jiǎn)歷數(shù)據(jù)傳輸通道是由服務(wù)器端發(fā)起的,服務(wù)器使用20端口鏈接客戶端的某一個(gè)大于1024的端口。 FTP客戶端首先和FTP 服務(wù)端的tcp 21端口建立連接,通過(guò)這個(gè)通道發(fā)送命令,客戶端需要接受數(shù)據(jù)的時(shí)候在這個(gè)通道上發(fā)送PORT命令。PORT命令包含了客戶端
用什么端口(大于1024 的端口)接受數(shù)據(jù),在傳送數(shù)據(jù)的時(shí)候,服務(wù)器端通過(guò)自己的TCP
20 端口發(fā)送數(shù)據(jù),FTP 服務(wù)端必須和客戶端建立一個(gè)新的鏈接來(lái)傳送數(shù)據(jù)。

客戶端使用1024以上的端口鏈接服務(wù)器的21號(hào)端口,并且會(huì)實(shí)現(xiàn)開啟一個(gè)1024+N的dua扣準(zhǔn)備讓服務(wù)器來(lái)鏈接,服務(wù)器得知客戶端準(zhǔn)備的端口后,用20號(hào)端口與客戶端鏈接,其中21號(hào)端口稱為鏈接鏈路,20號(hào)端口稱為數(shù)據(jù)鏈路,創(chuàng)建數(shù)據(jù)鏈路時(shí)server端處于主動(dòng)鏈接客戶端的狀態(tài),稱為:主動(dòng)傳輸模式。

PASV模式(被動(dòng)方式)

PASV模式中,數(shù)據(jù)傳輸?shù)耐ǖ赖慕⑹怯蒄TP客戶端發(fā)起的,他是用一個(gè)大于1024的端口鏈接服務(wù)器的1024以上的某一個(gè)端口。在建立控制通道的時(shí)候和PORT模式
類似,當(dāng)客戶端通過(guò)這個(gè)通道發(fā)送PASV命令的時(shí)候,FTP server打開一個(gè)大于1024的隨機(jī)端口并進(jìn)行數(shù)據(jù)的傳輸,這個(gè)時(shí)候FTP server 不再需要建立一個(gè)新的
和客戶端之間的鏈接傳送數(shù)據(jù)。

客戶端使用1024以上的端口鏈接服務(wù)器端的21端口,服務(wù)器接到鏈接請(qǐng)求后,開啟一個(gè)1024+M的端口,等待客戶端來(lái)鏈接,在通知客戶端這個(gè)等待連接的端口號(hào)是1024+M,客戶端接到服務(wù)器端的信息后,開啟新的一個(gè)1024+N的端口與1024+M進(jìn)行鏈接,其中21號(hào)端口為連接鏈路,1024+M端口為數(shù)據(jù)鏈路,創(chuàng)建數(shù)據(jù)鏈接時(shí),server端處于被客戶端鏈接的狀態(tài),所以稱為:被動(dòng)傳輸模式。

[root@localhost ~]# cat /etc/vsftpd/vsftpd.conf # Example config file /etc/vsftpd/vsftpd.conf # # The default compiled in settings are fairly paranoid. This sample file # loosens things up a bit, to make the ftp daemon more usable. # Please see vsftpd.conf.5 for all compiled in defaults. # # READ THIS: This example file is NOT an exhaustive list of vsftpd options. # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's # capabilities. # # Allow anonymous FTP? (Beware - allowed by default if you comment this out). anonymous_enable=YES # 匿名用戶是否可以訪問(wèn)FTP # # Uncomment this to allow local users to log in. # When SELinux is enforcing check for SE bool ftp_home_dir local_enable=YES # 本地用戶是否登錄 # # Uncomment this to enable any form of FTP write command. write_enable=YES # 允許FTP的寫指令 # # Default umask for local users is 077. You may wish to change this to 022, # if your users expect that (022 is used by most other ftpd's) local_umask=022 # 本地用戶建立文件的權(quán)限 # # Uncomment this to allow the anonymous FTP user to upload files. This only # has an effect if the above global write enable is activated. Also, you will # obviously need to create a directory writable by the FTP user. # When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access #anon_upload_enable=YES # 允許匿名用戶創(chuàng)建文件 # # Uncomment this if you want the anonymous FTP user to be able to create # new directories. #anon_mkdir_write_enable=YES # 允許匿名用戶創(chuàng)建新目錄 # # Activate directory messages - messages given to remote users when they # go into a certain directory. dirmessage_enable=YES # # Activate logging of uploads/downloads. xferlog_enable=YES # 使用日志功能 # # Make sure PORT transfer connections originate from port 20 (ftp-data). connect_from_port_20=YES # 主動(dòng)模式傳輸使用20端口 # # If you want, you can arrange for uploaded anonymous files to be owned by # a different user. Note! Using "root" for uploaded files is not # recommended! #chown_uploads=YES #chown_username=whoever # # You may override where the log file goes if you like. The default is shown # below. #xferlog_file=/var/log/xferlog # 日志文件位置 # # If you want, you can have your log file in standard ftpd xferlog format. # Note that the default log file location is /var/log/xferlog in this case. xferlog_std_format=YES # 使用標(biāo)準(zhǔn)模式 # # You may change the default value for timing out an idle session. #idle_session_timeout=600 # 空閑鏈接超時(shí) # # You may change the default value for timing out a data connection. #data_connection_timeout=120 # 數(shù)據(jù)傳輸超時(shí) # # It is recommended that you define on your system a unique user which the # ftp server can use as a totally isolated and unprivileged user. #nopriv_user=ftpsecure # # Enable this and the server will recognise asynchronous ABOR requests. Not # recommended for security (the code is non-trivial). Not enabling it, # however, may confuse older FTP clients. #async_abor_enable=YES # # By default the server will pretend to allow ASCII mode but in fact ignore # the request. Turn on the below options to have the server actually do ASCII # mangling on files when in ASCII mode. # Beware that on some FTP servers, ASCII support allows a denial of service # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd # predicted this attack and has always been safe, reporting the size of the # raw file. # ASCII mangling is a horrible feature of the protocol. #ascii_upload_enable=YES #ascii_download_enable=YES # # You may fully customise the login banner string: #ftpd_banner=Welcome to blah FTP service. # # You may specify a file of disallowed anonymous e-mail addresses. Apparently # useful for combatting certain DoS attacks. #deny_email_enable=YES # (default follows) #banned_email_file=/etc/vsftpd/banned_emails # # You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that # the user does not have write access to the top level directory within the # chroot) #chroot_local_user=YES #chroot_list_enable=YES # (default follows) #chroot_list_file=/etc/vsftpd/chroot_list # # You may activate the "-R" option to the builtin ls. This is disabled by # default to avoid remote users being able to cause excessive I/O on large # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume # the presence of the "-R" option, so there is a strong case for enabling it. #ls_recurse_enable=YES # # When "listen" directive is enabled, vsftpd runs in standalone mode and # listens on IPv4 sockets. This directive cannot be used in conjunction # with the listen_ipv6 directive. listen=NO # # This directive enables listening on IPv6 sockets. By default, listening # on the IPv6 "any" address (::) will accept connections from both IPv6 # and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6 # sockets. If you want that (perhaps because you want to listen on specific # addresses) then you must run two copies of vsftpd with two configuration # files. # Make sure, that one of the listen options is commented !! listen_ipv6=YESpam_service_name=vsftpd # 定義PAM所使用的名稱 userlist_enable=YES # user_list文件有效, tcp_wrappers=YES # 開啟tcp_wrappers支持 [root@localhost ~]#

?FTP本地用戶訪問(wèn)

首先安裝ftp:yum install ftp ,,,然后通過(guò)ftp即可在本地訪問(wèn)

首先確保下面三項(xiàng)為YES

anonymous_enable=YES anon_upload_enable=YES anon_mkdir_write_enable=YES [root@localhost ~]# systemctl start vsftpd.service [root@localhost ~]# systemctl status vsftpd.service ● vsftpd.service - Vsftpd ftp daemonLoaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; vendor preset: disabled)Active: active (running) since 三 2018-09-12 11:12:50 CST; 1s agoProcess: 57386 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)Main PID: 57388 (vsftpd)CGroup: /system.slice/vsftpd.service└─57388 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf9月 12 11:12:49 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon... 9月 12 11:12:50 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon. [root@localhost ~]#

NFS服務(wù)器

NFS最初是由SUN公司開發(fā)的,目的就是在計(jì)算機(jī)不同操作系統(tǒng)之間可以彼此共享文件,NFS配置簡(jiǎn)單,快捷??蛻舳丝梢酝ㄟ^(guò)mount掛載之后像使用本地文件系統(tǒng)一樣來(lái)只用遠(yuǎn)端共享目錄。

在centos 7 上搭建NFS服務(wù)器比以往其實(shí)更加簡(jiǎn)單,卸掉了protmap服務(wù),而是用rpcbind服務(wù)。

NFS服務(wù)器實(shí)現(xiàn)共享

/etc/exports 文件指定了那個(gè)文件系統(tǒng)的NFS應(yīng)該輸出(有時(shí)候也可以稱之為“共享”)

/etc/exports 里面每行指定一個(gè)輸出的文件系統(tǒng)和那些機(jī)器可以訪問(wèn)該文件系統(tǒng)。

在指定機(jī)器訪問(wèn)權(quán)限的同時(shí),訪問(wèn)選項(xiàng)開關(guān)也可以被指定。

/ect/export 格式:

共享目錄 主機(jī)1或ip1(選項(xiàng)1,選項(xiàng)2) 主機(jī)2或ip2(選項(xiàng)3,選項(xiàng)4)

主機(jī)名稱格式:

單個(gè)主機(jī)/IP:station1.uplooking.com 192.168.1.1 IP網(wǎng)絡(luò): 192.168.1.0/255.255.255.0 172.16.1.0/15 通配符: *.uplooking.com

一般選項(xiàng):

ro :read only rw :允許nfs read write 請(qǐng)求 sync:同步存儲(chǔ)后回應(yīng)請(qǐng)求 async:在同步之前回應(yīng)請(qǐng)求

用戶ID映射:

root_squash :映射uid/gid 0 到匿名 uid/gid no_root_squash: 關(guān)閉root squashing all_squash:映射所有的uid/gid到匿名的uid/gid anonuid and anongid:映射uid/gid到指定的uid/gid

exportfs 命令用來(lái)管理當(dāng)前NFS共享的文件系統(tǒng)列表。這個(gè)列表保存在一個(gè)單獨(dú)的文件/var/lib/nfs/etab中,當(dāng)遠(yuǎn)端主機(jī)要求對(duì)一個(gè)文件系統(tǒng)樹加載并訪問(wèn)時(shí)由mountd讀取,列表中活動(dòng)的一部分也保存在內(nèi)核共享表中。通常etab在執(zhí)行exportfs -a。的時(shí)候,根據(jù)/etc/exports中定義的共享列表來(lái)初始化。但是,管理員可以選擇添加或者刪除獨(dú)立的文件系統(tǒng),不必修改/etc/exports,只要執(zhí)行exportfs就可以了

-a:全部掛載(或卸載) /etc/exports 文件內(nèi)的設(shè)定。 -r :重新掛載/etc/exports中的設(shè)置,此外同步更新/etc/exports以及/var/lib/nfs/etab中的內(nèi)容 -u:卸載某一目錄 -v:在export時(shí)將共享的目錄顯示在屏幕上 [root@localhost ~]# exportfs -rv # 全部重新export一次 [root@localhost ~]# exportfs -au # 全部卸載 [root@localhost ~]#

。。。更多請(qǐng)移駕百度。。。

Samba服務(wù)器

Samba,是一種自由軟件,用來(lái)讓Unix系列的操作系統(tǒng)與微軟Windows操作系統(tǒng)的SMB/CIFS網(wǎng)絡(luò)協(xié)議做聯(lián)結(jié)。

應(yīng)用環(huán)境:

文件和打印機(jī)共享:文件和打印機(jī)共享是Samba的主要功能,SMB進(jìn)程實(shí)現(xiàn)資源的共享,將文件和打印機(jī)發(fā)布到網(wǎng)絡(luò)之中,以供用戶可以訪問(wèn)。 身份驗(yàn)證和權(quán)限設(shè)置:smbd服務(wù)支持user mode和domain mode等身份驗(yàn)證和權(quán)限設(shè)置模式,通過(guò)加密方式可以保護(hù)共享的文件和打印機(jī)。 名稱解析:Samba通過(guò)nmbd服務(wù)可以搭建NBNS服務(wù)器,提供名稱解析,將計(jì)算機(jī)的NetBIOS名解析為IP地址。 瀏覽服務(wù):局域網(wǎng)中,Samba服務(wù)器可以成為貝蒂主瀏覽服務(wù)器(LMB),保存可用資源列表,當(dāng)使用客戶端訪問(wèn)Windows網(wǎng)上鄰居時(shí),會(huì)提供瀏覽器列表,顯示共享目錄,打印機(jī)等資源

更多請(qǐng)百度。。等用到了再補(bǔ)充。。

?

轉(zhuǎn)載于:https://www.cnblogs.com/52-qq/p/9634059.html

總結(jié)

以上是生活随笔為你收集整理的服务管理-文件服务器的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 中文字幕超清在线观看 | 日韩av在线播放一区 | 亚洲蜜桃精久久久久久久久久久久 | 久久99精品久久久久久国产越南 | 亚洲视频你懂的 | 国产中文 | 99国产在线播放 | 精品第一页 | www男人的天堂 | 成人午夜影视 | 欧美亚洲大片 | 亚洲一区二区偷拍 | 浪漫樱花在线观看高清动漫 | 亚洲国产aⅴ精品一区二区 日韩黄色在线视频 | 九九资源网| 精品98| 日本成人片网站 | 百合sm惩罚室羞辱调教 | 国产精品久久久久不卡 | 国产成人综合在线观看 | 波多野结衣一区二区 | 欧美在线一 | 国产精品久久精品 | 天天爱天天干天天操 | 国产精品一区二区在线看 | 另类性姿势bbwbbw | 亚洲91av | 大又大粗又爽又黄少妇毛片 | 亚洲制服丝袜诱惑 | 91麻豆成人精品国产免费网站 | 人妻少妇偷人精品久久久任期 | 狠狠干欧美 | 国产视频一区二区不卡 | 激情综合图区 | 亚洲天堂av女优 | 亚洲一区二区三区在线视频观看 | 久久一级大片 | 永久av在线 | 日本在线免费观看视频 | 天天想你在线观看完整版电影高清 | bbbbbbbbb毛片大片按摩 | 婷婷六月色 | 欧美a级成人淫片免费看 | 成人必看www. | 国产 日韩 欧美 精品 | 欧洲日韩一区二区三区 | 怡红院av亚洲一区二区三区h | 手机在线成人av | 国产强被迫伦姧在线观看无码 | 激情欧美一区二区三区 | 欧美精品免费视频 | 一级中文字幕 | 祥仔视觉av | 亚色91| 激情五月在线 | 精品乱子一区二区三区 | 秋霞二区 | 久久久亚洲av波多野结衣 | www.桃色 | 人人妻人人玩人人澡人人爽 | 国产精自产拍久久久久久蜜 | 免费黄av | 亚洲人午夜射精精品日韩 | 春色导航 | 国产精品丝袜黑色高跟鞋的设计特点 | 狠狠干综合| 日韩丰满少妇无码内射 | 日本少妇激情 | 美女a视频| av在线播放器 | 超碰在线国产97 | 色播激情网 | 成人在线视频播放 | 亚洲黄色第一页 | 四虎视频国产精品免费 | 精品视频在线播放 | 中文字幕有码视频 | 久久午夜场 | 东方影库av | 在线97视频| 天堂中文资源在线观看 | 美女网站免费观看视频 | 亚洲九九| 麻豆高清免费国产一区 | 三上悠亚在线一区 | 人人舔人人 | 婚后打屁股高h1v1调教 | 亚洲精品aⅴ中文字幕乱码 国产精品调教视频 | 一本一道久久综合狠狠老精东影业 | 高清乱码免费看污 | 欧美插插视频 | 国产毛毛片 | 国产一区不卡 | 九草影院 | 久久精品免费av | 潘金莲黄色一级片 | 日本福利社 | 人人爽久久涩噜噜噜网站 | 精品久久久久久久久久久久久久久 |