zoukankan      html  css  js  c++  java
  • Create Shortcut for SSH Hosts

    You frequently visit host 10.0.7.141 for example. It's a waste to type "ssh gcp@10.0.7.141" every time you connect it. So you can create a file ~/.ssh/config, and add follow lines to it:

    Host 141
    
    Hostname 10.0.7.141
    
    User gcp
    
    [Port 22]
    
    [IdentityFile ~/.ssh/id_rsa.pub]
    

    Now you can use "ssh 141" to connect to this host.

    Or use "scp user@141:/home/user/" to copy files.

    With key authorization (see note "Login SSH Server without Password"), you can connect to this host without inputing password. You can copy local file to remote host with "scp myfile 141:/target/path", and copy file on remote host to local folder with "scp 141:/source/path/to/file /target/folder".

    Note: IdentifyFile is the shortcut of "-i /path/to/public-key" option of "ssh" command;

  • 相关阅读:
    Zepto源码分析-动画(fx fx_method)模块
    CSS3用法理解
    移动端网页meta设置和响应式
    javascript基础-正则表达式
    net core 2.x
    angular
    .net core 2.x
    .net core 2.x
    DDD
    DDD
  • 原文地址:https://www.cnblogs.com/darkmatter/p/3606810.html
Copyright © 2011-2022 走看看