跳至主要内容

自己动手搭建FTP服务器

之前跟着廖廖学习的时候,觉得搭建一个ftp服务器是很简单的事情,自己动手在阿里云上搭建了一次,才发现,很多东西,概念没有理解的很清晰,将我搭建的过程记录分享给大家,也作为备忘。

操作环境

阿里云 CentOS 6.5

搭建过程

yum install vsftpd
配置/etc/vsftpd/vsftpd.conf文件
根据配置文件,在/etc/vsftpd中新建virtual_users.db文件和user目录

碰到问题

530 login incorrect

  • 后来发现原因是pam模块错误,需要自己根据配置文件的命名新建pam模块,而新建pam模块需要根据virtual_users.txt生成virtual_users.db文件,然后在pam配置文件中制定db文件路径,才能在登录时成功,务必注意,单行是帐号,双行是密码,最后一行要有回车,否则系统无法识别原txt文件设置权限仅备忘用
  • 生成db文件需要用到db4-utils工具,默认已经安装,命令是db_load -T -t hash -f virtual_users.txt virtual_users.db
    • 专业术语是建立虚拟用户数据库,步骤是新建一个txt文档--db4-util

ftp_username无法识别

  • 原因在于没有创建一个系统账户,后来新建一个vsftpd账户并nologin设置
    • 命令 useradd -d /home/www/ -s /sbin/nologin vsftpd (新建用户,并制定目录,设置shell为nologin)

还没有解决

  • stand alone机制还不是很理解
  • vsftpd.conf配置文件allow_writeable_chroot=YES这一项不是很理解

一些新的理解

登录ftp的三种方式

  • 匿名                       默认的方式,用户名为ftp/anonymous
  • 本地用户登录         系统用户,存在于/etc/passwd中的用户
  • 虚拟用户登录         FTP专有用户,好处是只能访问ftp服务器资源,增加系统安全性,两种方式实现虚拟用户,一是本地数据文件,而是数据库服务器

SCP命令

  • scp /home/../news.txt name@ip:/etc/vsftpd    本机文件复制到远程服务器
  • scp remote@ip:/usr/local/ /home/administrator    远程服务器复制到本机

uname命令

  • -r
  • -a
  • cat /etc/redhat-release     查看CentOS

nologin-shell用户

  • 已存在用户    usermod -s /sbin/nologin name
  • 新建用户        useradd  -s /sbin/nologin newname

CentOS防火墙

  • CentOS 6之前用的是iptables机制
    • chkconfig iptables on    重启生效
    • service iptables start    即时生效,重启失效
  • CentOS 7之后默认安装firewalld
    • 命令和之前类似

Popular posts from 产品随想的博客

黑客讲述渗透Hacking Team全过程

原文地址在 Freebuf ,后来已经被删除 Wayback Machine 备份 近期,黑客 Phineas Fisher在pastebin.com上讲述了入侵Hacking Team的过程,以下为其讲述的原文情况,文中附带有相关文档、工具及网站的链接,请在安全环境下进行打开,并合理合法使用。作者部分思想较为激进,也请以辩证的观点看待之。 1、序言 在这里,可能你会注意到相比于前面的一个版本,这个版本的内容及语言有了一些变化,因为这将是最后一个版本了 [1] 。对于黑客技术,英语世界中已经有了许多书籍,讲座,指南以及关于黑客攻击的知识。在那个世界,有许多黑客比我优秀,但他们埋没了他们的天赋,而为所谓的“防护”服务商(如Hacking Team之流的),情报机构服务工作。黑客文化作为一项非主流文化诞生于美国,但它现在只保留了它本质的魅力,其他均被同化了。从黑客的本质出发,至少他们可以穿着一件T恤,把头发染成蓝色,用自己的黑客的名字,随意 洒脱 地做着自己喜欢的事件,而当他们为别人(前文所指的 Hacking Team及情报机构 )工作的时候,会感觉自己像个反抗者。 如果按照传统的方式,你不得不潜入办公室偷偷拿到文件[2],或者你不得不持枪抢劫银行。但现在你仅仅需要一台笔记本,躺在床上动动手指便可做得这一切[3][4]。像CNT在入侵伽玛集团(Gamma Group)之后说的,“让我们以一种新的斗争方式向前迈进吧”[5]。 [ 1 ] http: / /pastebin.com/raw .php?i=cRYvK4jb [ 2 ] https: / /en.wikipedia.org/wiki /Citizens%27_Commission_to_Investigate_the_FBI [3] http:/ /www.aljazeera.com/news /2015/ 09/algerian-hacker-hero-hoodlum- 15092108 3914167 .html [ 4 ] https: / /securelist.com/files /2015/ 02 /Carbanak_APT_eng.pdf  [ 5 ] http: / /madrid.cnt.es/noticia /consideraci...

360T7 刷机步骤及固件

https://cmi.hanwckf.top/p/360t7-firmware/   360T7的固件支持由immortalwrt-mt798x项目提供支持,请参考: https://cmi.hanwckf.top/p/immortalwrt-mt798x https://github.com/hanwckf/immortalwrt-mt798x 刷机步骤 参考 此处 的办法开启原厂固件的UART和telnet功能 在以下链接下载360T7测试固件(纯净版,无任何插件) https://wwd.lanzout.com/b0bt9idwd 密码:ezex (此固件已过时,请选择其它更新的固件) 接下来将刷入修改版uboot。修改版uboot的优点有: 固件分区可达108MB,原厂uboot只能使用36M 自带一个简单的webui恢复页面 到以下仓库的Release页面下载uboot,目前暂时仅支持360T7,后续将支持更多mt798x路由器。 推荐使用 mt7981_360t7-fip-fixed-parts.bin , fixed-parts 代表uboot分区表在编译期间固定,不会随着uboot环境变量变化。 https://github.com/hanwckf/bl-mt798x/releases/latest 将 mt7981_360t7-fip-fixed-parts.bin 通过HFS等方式上传到路由器,使用以下命令刷入uboot mtd write mt7981_360t7-fip-fixed-parts.bin fip 确认刷入完毕后,拔掉路由器电源。然后将电脑的IP地址设置为固定的 192.168.1.2 ,接着按住路由器的RESET按钮后通电开机,等待8s后用浏览器进入 192.168.1.1 在uboot恢复页面选择要刷入的固件。immortalwrt-mt798x目前编译两个版本的360T7固件。 建议修改版uboot直接使用 immortalwrt-mediatek-mt7981-mt7981-360-t7-108M-squashfs-factory.bin ,两种固件区别如下: mt7981-360-t7-108M 为108M固件分区,原厂uboot不可启动,需要修改版u...

产品爱好者周刊 第26期:PRISM, XKeyscore, Trust No One

  Products Gitea - Git with a cup of tea   https://gitea.io/en-us/ A painless self-hosted Git service. 自建Git服务,避免GitHub隐私侵犯 https://github.com/objective-see/LuLu LuLu is the free macOS firewall 监视Mac的出站流量,且阻断 OverSight   https://github.com/objective-see/OverSight OverSight monitors a mac's mic and webcam, alerting the user when the internal mic is activated, or whenever a process accesses the webcam. 监视是否有应用调用Mac的麦克风、摄像头 Mozilla Hubs   https://github.com/mozilla/hubs The client-side code for Mozilla Hubs, an online 3D collaboration platform that works for desktop, mobile, and VR platforms. 开源的多人虚拟空间,Mozilla打造,企业级VR诉求 数字移民   https://shuziyimin.org 关于内容源、工具的推荐,适合刚接入国际的新人 SimpleLogin   https://simplelogin.io/ 匿名邮箱工具,转发用,Michael Bazzell推荐 Telegram 群组、频道、机器人 - 汇总分享   https://congcong0806.github.io/2018/04/24/Telegram/#机器人-bot https://archive.ph/iJMBj 献给那些将来到Telegram的朋友 Design Patrick Wardle   https://www.instagram.com/patrickwardle/?hl=en 他的IG,摄影也精彩,审美...

UNstudio实习经验分享

再过一周,我就将离开UNstudio阿姆斯特丹总部,到其上海分部了,鉴于上海分部目前还不承担设计任务,因此可以视为我UNstudio参与设计的体验即将告一段落。这个实习,原定3个月,后来被要求延长到了6个月,后来又延长到9个月,现在看来最终大概有11个月——那天一问,发现我的合同已经到了9月份了,赶紧声明不能这么长,我8月得回学校了。

文明、现代化、价值投资与中国 By 李录

 价值投资的概念/框架: 1)股票是对公司的所有权,而不仅仅是一张纸; 2)安全边际;(预测未来,但要留好安全边际) 3)市场先生;(让市场来服务你,而不是被指导) 4)能力圈;(建立属于自己的能力圈) 公司的来源: 欧洲扩张,从国王到贵族,到有钱人,到平民 《价值线》-几千家公司过去10年的财务情况

Interview at the All Things Digital D5 Conference, Steve and Bill Gates spoke with journalists Kara Swisher and Walt Mossberg onstage in May 2007.

Kara Swisher: The first question I was interested in asking is what you think each has contributed to the computer and technology industry— starting with you, Steve, for Bill, and vice versa. Steve Jobs: Well, Bill built the first software company in the industry. And I think he built the first software company before anybody really in our industry knew what a software company was, except for these guys. And that was huge. That was really huge. And the business model that they ended up pursuing turned out to be the one that worked really well for the industry. I think the biggest thing was, Bill was really focused on software before almost anybody else had a clue that it was really the software that— KS: Was important? SJ: That’s what I see. I mean, a lot of other things you could say, but that’s the high-order bit. And I think building a company’s really hard, and it requires your greatest persuasive abilities to hire the best ...

产品爱好者周刊 第10期:乔布斯逝世10年

  产品爱好者周刊 第10期: 2021.10.14 Products 经济学人、卫报、Wired等电子周刊: https://github.com/hehonghui/the-economist-ebooks 每周均更新 Immersed: https://immersed.com/ 桌面端软件,可以虚拟出5个VR桌面,能模拟出在海滩、宇宙等地方,工作 它的员工写了篇自己工作流,非常酷 Working From Orbit: https://blog.immersed.team/working-from-orbit-39bf95a6d385 bilibili视频下载工具(开源) 哔哩下载姬 downkyi: https://github.com/leiurayer/downkyi Windows Only BilibiliVideoDownload: https://github.com/blogwy/BilibiliVideoDownload 多平台 BiliDuang:  https://github.com/kengwang/BiliDuang Versus: https://versus.com/cn 万物皆可比较 官网的范例,基本都是数码产品,可能是标准化产品有具体参数,容易比较些? News Jony Ive on What He Misses Most About Steve Jobs:  https://www.wsj.com/articles/jony-ive-steve-jobs-memories-10th-anniversary-11633354769 中文译本: https://archive.ph/EZihd Ideas Weather Spark:  https://weatherspark.com 全球城市的全年气候,用于去陌生城市、旅行规划了解城市天气,会有帮助 Long Now Foundation:  https://twitter.com/longnow 以10000年的跨度,去思考未来的可能性,真是一件很浪漫的事情 Outside interests Notion会私自查看用户的内容

A Sister’s Eulogy for Steve Jobs

I grew up as an only child, with a single mother. Because we were poor and because I knew my father had emigrated from Syria, I imagined he looked like Omar Sharif. I hoped he would be rich and kind and would come into our lives (and our not yet furnished apartment) and help us. Later, after I’d met my father, I tried to believe he’d changed his number and left no forwarding address because he was an idealistic revolutionary, plotting a new world for the Arab people. Even as a feminist, my whole life I’d been waiting for a man to love, who could love me. For decades, I’d thought that man would be my father. When I was 25, I met that man and he was my brother. By then, I lived in New York, where I was trying to write my first novel. I had a job at a small magazine in an office the size of a closet, with three other aspiring writers. When one day a lawyer called me — me, the middle-class girl from California who hassled the boss to buy us health insurance — and said his cl...

产品随想 | 周刊 第85期:e-Residency与数字游民

  David Shambaugh   https://www.google.com/search?q=David+Shambaugh 中国问题研究专家,著作极多 郭玉闪   https://zh.wikipedia.org/wiki/郭玉闪?useskin=vector 中国公共知识分子 我只想好好观影   github.com/BetterWorld-Liuser/autoMovies 刘煜辉:中国资本市场灵魂出窍 最有活力的公司几乎不在A股   https://finance.sina.com.cn/stock/marketresearch/2017-06-23/doc-ifyhmtek7705574.shtml 回看17年的专家讲话,还是挺有水平的,挺多都认可 纽约文化沙龙   https://www.youtube.com/@user-cu2hl5tf6y/videos 视频质量出奇的高,推荐 透视中国政治by吴国光、程晓农 备忘下,貌似评价挺好的一本书 CAPI China Chair Wu Guoguang (吴国光 / 吳國光)   https://www.youtube.com/playlist?list=PLIt1szHhnm_Hso3jGUbfGpnEAbsPOuEVV 因为热爱中国,我们越要看懂中国 AI Canon   https://a16z.com/2023/05/25/ai-canon/ in this post, we’re sharing a curated list of resources we’ve relied on to get smarter about modern AI. We call it the “AI Canon” because these papers, blog posts, courses, and guides have had an outsized impact on the field over the past several years. 希望中国的投資機構,也能有更多的分享與輸出,提升整個社會的認知 Cantonese Font 粵語字體   https://visual-fonts.com/zh/...