zoukankan      html  css  js  c++  java
  • 为跳板机创建跳转用户限制ssh登陆

    server

    create a user without shell access(proxy jump only)

    sudo -i
    useradd jump -m -d /home/jump -s /home/jump/nologin
    cd /home/jump
    cat <<EOF >> nologin
    #!/bin/bash
    echo "Hi there! You've successfully authenticated, but we do not provide shell access."
    EOF
    chmod +x nologin
    touch .hushlogin
    mkdir -m 700 .ssh
    chmod 600 .ssh/authorized_keys >> !#:2
    chown -R jump:jump .ssh
    vi .ssh/authorized_keys
    # paste your public key here
    ZZ
    

    client

    modify ~/.ssh/config

    Host dev
        HostName 192.168.1.123
        User your_name
        ProxyJump jump@ip_jump_host:port
    

    tested on vscode remote and ssh

  • 相关阅读:
    Windbg DUMP
    NET媒体文件操作组件TagLib
    NET Framework、.NET Core、Xamarin
    面向切面编程
    微服务
    NET Core
    Yeoman generator
    Service Fabric
    Vue.JS 2.x
    CoreCLR
  • 原文地址:https://www.cnblogs.com/azureology/p/14653783.html
Copyright © 2011-2022 走看看