zoukankan      html  css  js  c++  java
  • 禁止linux使用scp和sftp

    https://blog.slogra.com/post-588.html

     公司新上了一台测试服务器,要求禁止使用scp和sftp,说是怕服务器上数据传出去,我说ssh在使用一样会有数据传出去的,但技术总监说毕竟他们不知道那么高深的方法,所以禁止了scp和sftp就够了,好吧,都这样说了我还有什么办法,只能照做.
      系统:centos 5.x
    1.先禁止scp
    rpm -qa|grep openssh-*
    yum remove openssh-clients -y

    删除了openssh-clients后,再执行scp,就会报下面的错误:
    -bash: scp: command not found

    2.禁止sftp
    vi /etc/ssh/sshd_config
    Subsystem      sftp    /usr/libexec/openssh/sftp-server
    把这行注释了,如下:
    #Subsystem      sftp    /usr/libexec/openssh/sftp-server

    退出保存后,重启sshd:
    service sshd restart

    https://blog.csdn.net/zhang_yang_43/article/details/68950602

    openssh-server和openssh-clients的区别



    好了,这样就可以交差了.

    • openssh-server的功能主要是作为一个服务运行在后台,如果这个服务开启,我们就可以用一些远程连接工具来连接centos。因为minimal版本自带openssh-server,所以XShell可以连上centos

    • openssh-client的功能我觉得类似于XShell,可以作为一个客户端连接上openssh-server,但是Centos6.4的minimal版本不包括openssh-client,所以centos之前出现无法使用ssh登录的情况,centos可以使用如下命令安装客户端:

    1.  
      安装wget
    2.  
      yum -y install wget
    3.  
       
    4.  
      安装openssh-client
    5.  
      yum install openssh-clients
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • Ubuntu下可以使用如下命令openssh的服务端和客户端(好像安装openssh-server时也会自动安装openssh-clients)
    1.  
      sudo apt-get update
    2.  
      sudo apt-get install openssh-server
  • 相关阅读:
    javascript清空数组的三种方法
    assigning to rvalue错误的原因与解决方法
    form表单提交的disabled属性踩坑记录(某个字段死活保存不上)
    java对两个字符串数组取交集、并集和差集
    vue2.x学习笔记(三十二)
    vue2.x学习笔记(三十)
    vue2.x学习笔记(二十九)
    vue2.x学习笔记(二十八)
    数据结构与算法之间的关系
    记一次解决CSS定位bug思路
  • 原文地址:https://www.cnblogs.com/zhoading/p/14106607.html
Copyright © 2011-2022 走看看