freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

用linux架設(shè)ftp服務(wù)器-文庫吧

2025-08-01 15:39 本頁面


【正文】 asswd),把下面這一行改為: ftpadmin:x:502:502::/home/ftp/ftpadmin/:/dev/null 改為: ftpadmin:x:502:502::/home/ftp/./ftpadmin/:/dev/null 帳號為 “ftpadmin” ,這這個(gè)帳號的家目錄有一些奇怪。第一部分 “/home/ftp/” 表示 “chroot” 時(shí)作為根目錄的目錄 。被點(diǎn)號分開的 “/ftpadmin” 表示當(dāng)?shù)卿?ftp服務(wù)器的時(shí)候會(huì)自動(dòng)轉(zhuǎn)到這個(gè)目錄?!?dev/null” 這個(gè)空 shell 不允許 “ftpadmin” 像正常用戶那樣登錄。經(jīng)過這些改變, “ftpadmin” 用戶用的不是真正的 shell 而是偽 shell,這樣訪問 ftp服務(wù)器就受到限制。 創(chuàng)建一個(gè) “chroot” 用戶環(huán)境 先要?jiǎng)?chuàng)建一個(gè)簡單的根文件系統(tǒng)( root file system),包含有足夠的文件,如果二進(jìn)制程序、口令文件,等等。當(dāng)用戶登錄的時(shí)候, Unix 就可以改變根文件系統(tǒng)( chroot)。注意一下,如果編 譯的時(shí)候象上面那樣加上 “ enablels” 參數(shù), “/home/ftp/bin” 和 “/home/ftp/lib” 兩個(gè)目錄就可以不要了,因?yàn)閃UFTP 會(huì)用自己帶的 “l(fā)s” 。不過我們還是介紹一下舊的方法,也就是把 “/bin/ls” 拷貝到“/home/ftp/bin” ( chroot 之后就是 “/bin” )目錄下,然后把相關(guān)的運(yùn)行庫拷貝到 “/home/ftp/lib”目錄下。 第一步 創(chuàng)建改變根文件系統(tǒng)( chrooted)環(huán)境所需要的所有的目錄: [root@deep] mkdir /home/ftp/dev [root@deep] mkdir /home/ftp/etc [root@deep] mkdir /home/ftp/bin (require only if you are not using the “ enablels” option) [root@deep] mkdir /home/ftp/lib (require only if you are not using the “ enablels” option) 第二步 把新目錄的權(quán)限設(shè)成 0511: [root@deep] chmod 0511 /home/ftp/dev [root@deep] chmod 0511 /home/ftp/etc [root@deep] chmod 0511 /home/ftp/bin (require only if you are not using the “ enablels” option) [root@deep] chmod 0511 /home/ftp/lib (require only if you are not using the “ enablels” option) 上面這些 “chmod” 命令把 chrooted之后的 “dev” 、 “etc” 、 “bin” 和 “l(fā)ib” 目錄設(shè)置成超級用戶 “root” 可讀、可執(zhí)行,用戶組和所有用戶可執(zhí)行。 第三步 把 “/bin/ls” 文件拷貝到 “/home/ftp/bin” 目錄下,并把 “l(fā)s” 的權(quán)限改為 0111(不運(yùn)行用戶改變這個(gè)文件)。 [root@deep] cp /bin/ls /home/ftp/bin (require only if you are not using the “ enablels” option) [root@deep] chmod 0111 /bin/ls /home/ftp/bin/ls (require only if you are not using the “ enablels” option) 第四步 找到 “l(fā)s” 程序所需的共享庫: [root@deep] ldd /bin/ls (require only if you are not using the “ enablels” option ) => /lib/ (0x00125000) /lib/ => /lib/ (0x00110000) 把共享庫拷貝到 “/home/ftp/lib” 目錄下: [root@deep] cp /lib/ /home/ftp/lib/ (require only if you are not using the “ enablels” option) [root@deep] cp /lib/ /home/ftp/lib/ (require only if you are not using the “ enablels” option) 注意:如果想用 Linux 的 “l(fā)s” 程序而不是用 WUftpd 自帶的 “l(fā)s” (編譯時(shí)加上 “ enablels” 參數(shù)),才需要第三和第四步。 第五步 創(chuàng)建 “/home/ftp/dev/null” 文件: [root@deep] mknod /home/ftp/dev/null c 1 3 [root@deep] chmod 666 /home/ftp/dev/null 第六步 把 “group” 和 “passwd” 文件拷貝到 “/home/ftp/etc” 目錄下,然后再改變這兩個(gè)文件。 [root@deep] cp /etc/passwd /home/ftp/etc/ [root@deep] cp /etc/group /home/ftp/etc/ 編輯 “passwd” 文件( vi /home/ftp/etc/passwd)把除了 “root” 和允許使用 ftp 的用戶之外的所有其它項(xiàng) 刪掉。這對于改變根文件系統(tǒng)的環(huán)境很重要,改變之后的 “passwd” 文件會(huì)是象下面這樣的: root:x:0:0:root:/:/dev/null ftpadmin:x:502:502::/ftpadmin/:/dev/null 編輯 “group” 文件( vi /home/ftp/etc/group),把除了 “root” 和允許使用 ftp 的用戶之外的所有其它項(xiàng)刪掉。改變之后的 “group” 文件會(huì)是象下面這樣的: root:x:0:root ftpadmin:x:502: 配置 可以到 這去下載 “” 文件: “” 文件解開之后,可以在相應(yīng)的目錄下發(fā)現(xiàn)我們在這本書中介紹的所有軟件的配置文件。這樣就沒有必要手工重新生成這些文件,或者用拷貝粘貼的方法把它們粘貼到配置文件中去。不管是打算自己動(dòng)手生成配置文件還是拷貝現(xiàn)成的,你都 要學(xué)會(huì)自己修改配置文件并且把配置文件拷貝到正確的目錄下。下面將具體說明。 為了運(yùn)行 FTP 服務(wù)器,必須創(chuàng)建或者把下面的文件拷貝到相應(yīng)的目錄下: 把 “ftpaccess” 文件拷貝到 “/etc” 目錄下 把 “ftpusers” 文件拷貝到 “/etc” 目錄下 把 “ftphosts” 文件拷貝到 “/etc” 目錄下 把 “ftpgroups” 文件拷貝到 “/etc” 目錄下 把 “ftpconversion” 文件拷貝到 “/etc” 目錄下 把 “ftp” 文件拷貝到 “/etc/” 目錄下 把 “ftp d” 文件拷貝到 “/etc/” 目錄下 可以把 “” 解壓之后,找到上面列出來的文件,并拷貝到相應(yīng)的目錄下,或者用拷貝粘貼的方法從本書中直接粘貼出。 配置 “/etc/ftpaccess” 文件 “/etc/ftpaccess” 文件是用來配置 “ftpd” 的。這個(gè)文件主要是設(shè)置允許哪個(gè)用戶、多少用戶訪問ftp 服務(wù)器,以及一些安全方面的問題。配置文件的每一行或者定義一個(gè)屬性或者設(shè)定一個(gè)屬性值。對于非匿名的 “chroot” 訪問,必須創(chuàng)建一些 “guestgroup” ,每 一個(gè)都要對應(yīng) “/home/ftp/etc/group” 文件中的項(xiàng)。 創(chuàng)建 ftpaccess文件( touch /e
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1