• Linux远程登录


    SHH 配置文件

    /etc/shhd_config  服务端配置文件

    /etc/ssh_config  客户端配置文件

    [root@localhost ssh]# chkconfig --list sshd
    sshd               0:关闭    1:关闭    2:启用    3:启用    4:启用    5:启用    6:关闭
    [root@localhost ssh]# 

    【实验一:修改ssh端口】

    1.查找修改的端口是否已经被占用

    [root@localhost ssh]# netstat -ln |grep :22
    tcp        0      0 127.0.0.1:2208              0.0.0.0:*                   LISTEN      
    tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      
    tcp        0      0 127.0.0.1:2207              0.0.0.0:*                   LISTEN      
    tcp        0      0 :::22                       :::*                        LISTEN      
    [root@localhost ssh]# netstat -ln |grep :80

    2.修改配置文件,PORT 改为其他

    [root@localhost ssh]# vim /etc/ssh/sshd_config 

    3.查看修改后的效果

    [root@localhost ssh]# netstat -ln |grep :27101
    [root@localhost ssh]# service sshd restart
    停止 sshd:                                                [确定]
    启动 sshd:                                                [确定]
    [root@localhost ssh]# netstat -ln |grep :27101
    tcp        0      0 0.0.0.0:27101               0.0.0.0:*                   LISTEN      
    tcp        0      0 :::27101                    :::*                        LISTEN    

    4.linux远程登录

    [root@localhost /]# ssh -p27101 192.168.1.2

    5.linux远程拷贝 scp

     拷贝文件

    [root@localhost dump]# scp data1.dump 172.17.4.33:/scp/
    Address 172.17.4.33 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
    root@172.17.4.33's password: 
    data1.dump                                                                                                                                                              100% 6560KB   6.4MB/s   00:00    
    [root@localhost dump]# 

    拷贝目录

    [root@localhost /]# scp -r /dump/ 172.17.4.33:/scp/
    Address 172.17.4.33 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
    root@172.17.4.33's password: 
    data1.dump   
  • 相关阅读:
    volume 方式使用 Secret【转】
    查看 Secret【转】
    用 k8s 管理机密信息【转】
    MySQL 如何使用 PV 和 PVC?【转】
    【docker问题】Client.Timeout exceeded while awaiting headers
    PV 动态供给【转】
    回收 PV【转】
    NFS PersistentVolume【转】
    PV & PVC【转】
    IO流中的常见问题
  • 原文地址:https://www.cnblogs.com/yimiao/p/3970867.html
Copyright © 2020-2023  润新知