zoukankan      html  css  js  c++  java
  • ubuntu版本scp连接Permission denied, please try again.问题

    scp依赖于ssh服务

    1.scp连接到ubuntu版本时,使用的用户必须有操作目录的权限:

    例:scp /etc/my.cnf  mysql@192.168.2.100 /etc/

    192.168.2.100主机的mysql用户,必须得有/etc目录的操作权限,一般给全权限7

    2.如果是以root用户连接的话,这个时候得去修改ssh的配置文件,因为ubuntu上面安装ssh时,默认是不允许以root用户链接的。

    例如:scp /etc/my.cnf  root@192.168.2.100  /etc

    修改192.168.2.100上/etc/ssh/sshd_config文件,部分内容:

    vim sshd_config

    # default value.

    Port 22
    #AddressFamily any
    #ListenAddress 0.0.0.0
    #ListenAddress ::

    #HostKey /etc/ssh/ssh_host_rsa_key
    #HostKey /etc/ssh/ssh_host_ecdsa_key
    #HostKey /etc/ssh/ssh_host_ed25519_key

    # Ciphers and keying
    #RekeyLimit default none

    # Logging
    #SyslogFacility AUTH
    #LogLevel INFO

    # Authentication:

    LoginGraceTime 100m
    #PermitRootLogin prohibit-password
    PermitRootLogin yes
    StrictModes yes
    #MaxAuthTries 6
    #MaxSessions 10

    #PubkeyAuthentication yes

    3.重启ssh服务

    root@debian:/etc/ssh# service ssh restart
    root@debian:/etc/ssh# service sshd restart

    端口链接问题

    链接远程ssh22端口时被拒绝,这个时候第一个要干的是先检查ssh服务是否安装,主机是否监听22端口,上面正常后还是链接不上 这时候就去看防火墙,解决防火墙的问题。
  • 相关阅读:
    Java Native Method
    SQL语句优化
    Ibatis的环境搭建以及遇到的问题解决
    Java 构建器
    SpringMVC自定义视图 Excel视图和PDF视图
    java 枚举的常见使用方法
    mysql 根据某些字段之和排序
    MFC The Screen Flickers When The Image Zoomed
    How To Debug Qmake Pro File
    Gcc And MakeFile Level1
  • 原文地址:https://www.cnblogs.com/wonchaofan/p/13344449.html
Copyright © 2011-2022 走看看