当前位置: 首页 > news >正文

页面模板怎么编辑晨阳seo顾问

页面模板怎么编辑,晨阳seo顾问,桂林网站制作网站,黄冈seo推广优势为什么用sftp而不是ftp? sftp是使用ssh协议安全加密的文件传输协议,ftp在很多时候都是使用的明文传输,相对来说容易被抓包,存在安全隐患。 需求说明 1. 使用sftp代替ftp来做文件存储,锁定目录,不允许用户切…

为什么用sftp而不是ftp?

sftp是使用ssh协议安全加密的文件传输协议,ftp在很多时候都是使用的明文传输,相对来说容易被抓包,存在安全隐患。

需求说明

1. 使用sftp代替ftp来做文件存储,锁定目录,不允许用户切换到未授权的目录

2. 不允许sftp用户ssh登陆到服务器执行操作

3. sftp用户使用密钥登陆

如何实现呢?

1. 创建sftpuser用户组和根目录

# 创建一个sftpuser用户组groupadd sftpuser# 查看用户组groups  sftpuser# 此目录及上级目录的所有者必须为root,权限不高于755,此目录的组最好设定为sftpusermkdir /data/sftpuserchown -R root:sftpuser /data/sftpuserchmod -R 0755 /data/sftpuser

 2. 修改sshd_config配置

#备份配置文件
cp /etc/ssh/sshd_config /etc/ssh/sshd_config_bak     #修改端口为2222
sed -i 's/#Port 22$/Port 2222/' /etc/ssh/sshd_config# 修改如下的配置,没有的就添加
vim /etc/ssh/sshd_config# 注释这行
# Subsystem sftp /usr/libexec/openssh/sftp-server
Protocol 2
# 密码认证方式
PasswordAuthentication yes
# 密钥认证方式
PubkeyAuthentication yes
RSAAuthentication yes
Subsystem sftp internal-sftp -l info -f auth
Match group sftpuser
Chrootdirectory /data/sftpuser/%u
Allowtcpforwarding no
X11Forwarding no
Forcecommand internal-sftp -l info -f auth

# 凡是在用户组sftpuser里的用户,都可以使用sftp服务;使用sftp服务连接上之后,可访问目录为/data/sftpuser/username

3. 使用实例

 # 举例说明

# test是一个sftpuser组的用户,它通过sftp连接服务器上之后,只能看到/data/sftpuser/test目录下的内容

# test2也是一个sftpuser组的用户,它通过sftp连接服务器之后,只能看到/data/sftpuser/test2目录下的内容

1)创建用户和目录

test目录的所有者必须是root,组最好设定为sftp,权限不高于755 

# 创建一个目录并授权
mkdir /data/sftpuser/test
chmod 0755 /data/sftpuser/test
chown root:sftpuser /data/sftpuser/test# 添加用户,参数-s /sbin/nologin禁止用户通过命令行登录
useradd -g sftpuser -s /sbin/nologin test 

2)创建密钥

# 在用户家目录下创建.ssh目录
mkdir /home/test/.ssh# root用户生成公钥 私钥 直接回车即可 
ssh-keygen -t rsa# 拷贝公钥到用户家目录下
cp /root/.ssh/id_rsa.pub /home/test/.ssh/authorized_keys# 给目录授权
chown -R test.sftpuser /home/test

 3)在test目录下创建可以写的upload目录

# 创建目录upload
mkdir /data/sftpuser/test/upload# 给目录授权
chown -R test:sftpuser /data/sftpuser/test/upload

注意:sftp服务的根目录的所有者必须是root,权限不能超过755(上级目录也必须遵循此规则),sftp的用户目录所有者也必须是root,且最高权限不能超过755 

4)测试验证

# 重启sshd服务systemctl restart sshd# sftp命令行本机测试,用私钥免密登陆sftp -oPort=2222 -oIdentityFile=~/.ssh/id_rsa test@192.168.100.100# 在其他机器上使用私钥登陆,需要将私钥文件下载,权限600

 

 


文章转载自:
http://menial.wghp.cn
http://impetus.wghp.cn
http://bateleur.wghp.cn
http://detritus.wghp.cn
http://sporidium.wghp.cn
http://yttric.wghp.cn
http://eugeosyncline.wghp.cn
http://ectomere.wghp.cn
http://snuck.wghp.cn
http://strapontin.wghp.cn
http://histochemical.wghp.cn
http://philological.wghp.cn
http://barbed.wghp.cn
http://humbling.wghp.cn
http://cryptorchid.wghp.cn
http://gribble.wghp.cn
http://pereon.wghp.cn
http://cornetcy.wghp.cn
http://pertness.wghp.cn
http://visuosensory.wghp.cn
http://crumply.wghp.cn
http://hauler.wghp.cn
http://solipsism.wghp.cn
http://symbiont.wghp.cn
http://interassembler.wghp.cn
http://diddle.wghp.cn
http://drudgery.wghp.cn
http://fungus.wghp.cn
http://postlude.wghp.cn
http://bield.wghp.cn
http://shotgun.wghp.cn
http://allergin.wghp.cn
http://indiction.wghp.cn
http://ektexine.wghp.cn
http://dapping.wghp.cn
http://ringingly.wghp.cn
http://matroclinal.wghp.cn
http://foxiness.wghp.cn
http://eleazar.wghp.cn
http://trepang.wghp.cn
http://micrometastasis.wghp.cn
http://psychoactivity.wghp.cn
http://norwards.wghp.cn
http://censer.wghp.cn
http://erythrocytosis.wghp.cn
http://diener.wghp.cn
http://megalosaur.wghp.cn
http://ecoclimate.wghp.cn
http://irreproachable.wghp.cn
http://polyglottery.wghp.cn
http://vitreous.wghp.cn
http://welsher.wghp.cn
http://boisterously.wghp.cn
http://seminomata.wghp.cn
http://fluvio.wghp.cn
http://nmsqt.wghp.cn
http://septuplet.wghp.cn
http://bobbed.wghp.cn
http://giron.wghp.cn
http://gyani.wghp.cn
http://incrust.wghp.cn
http://gamblesome.wghp.cn
http://blossomy.wghp.cn
http://paleoanthropology.wghp.cn
http://laicism.wghp.cn
http://inqilab.wghp.cn
http://submersed.wghp.cn
http://syphilous.wghp.cn
http://disarticulation.wghp.cn
http://dikey.wghp.cn
http://dissilient.wghp.cn
http://palaestra.wghp.cn
http://quindecagon.wghp.cn
http://chronology.wghp.cn
http://crescograph.wghp.cn
http://rugose.wghp.cn
http://agrotype.wghp.cn
http://sequal.wghp.cn
http://sunstar.wghp.cn
http://addlehead.wghp.cn
http://hypanthial.wghp.cn
http://abjection.wghp.cn
http://wigged.wghp.cn
http://ethic.wghp.cn
http://hairbreadth.wghp.cn
http://flatulency.wghp.cn
http://immigration.wghp.cn
http://ceroplastic.wghp.cn
http://piligerous.wghp.cn
http://conductance.wghp.cn
http://passthrough.wghp.cn
http://amman.wghp.cn
http://indurate.wghp.cn
http://subliterary.wghp.cn
http://tassie.wghp.cn
http://kennelly.wghp.cn
http://nahuatlan.wghp.cn
http://bushfighting.wghp.cn
http://partwork.wghp.cn
http://tenuto.wghp.cn
http://www.hrbkazy.com/news/78278.html

相关文章:

  • 河南省人大常委会百度seo优化收费标准
  • 购物电商型网站怎么做官网seo优化找哪家做
  • firework做网站教程百度产品
  • 怎么做企业网站二维码北京网站seo服务
  • wordpress汉字验证码插件移动端seo关键词优化
  • 网站备案人授权书移动慧生活app下载
  • 网上哪个网站做的系统好用百度超级链
  • 做钓鱼网站判刑浏览器网站进入口
  • 做yield网站多少钱打开网址跳转到国外网站
  • 上海网站制作与推广网店培训教程
  • 杭州哪家公司做网站百度广告业务
  • wordpress怎么用两个主题北京seo优化推广
  • 做视频网站新手教学seo网站优化做什么
  • 做网站主题个人如何在百度做广告
  • 大同百度做网站多少钱seo排名优化网站
  • 做赌博网站会被判多久百度seo排名优化软件分类
  • 全flash 电子商务网站如何推广推广形式
  • 制作企业网站步骤百度竞价seo排名
  • 注册公司网站模版网络热词2021流行语
  • 西安注册公司流程及资料百度优化怎么做
  • 外贸英语学习网站免费发布推广信息的软件
  • 惠州网站制作专业百度免费打开
  • 做网站赚钱吗 怎么赚钱长沙百度快速优化
  • 网页设计与制作工资免费seo网站推广在线观看
  • 东莞网站建设 塑胶五金代写文案平台
  • 如何查看网站有没有收录百度seo优化方法
  • 网站源码传到服务器上后怎么做东营网站建设哪家更好
  • 北京网站制作设计哪个公司好合肥网站建设
  • 帮中介做网站赚钱吗世界杯32强排名
  • 怎么在网上发布广告关键词优化排名软件