`
yang_kunlun
  • 浏览: 77225 次
  • 性别: Icon_minigender_1
  • 来自: 地球
最近访客 更多访客>>
社区版块
存档分类
最新评论

Setting up SSH keys

阅读更多
1. Create a public and private key on your computer (id_rsa, id_rsa.pub)

ssh-keygen -t rsa                              


2. Copy public key to the server

scp id_rsa.pub <username@host>:~/.ssh/         


3. Login server

ssh username@host


4. Check to see if the .ssh directory and authorized key directory exists

4a. If they do not exist:

mkdir ~/.ssh
chmod 700 ~/.ssh
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
rm ~/id_rsa.pub

4b. If they do exists

cat ~/.ssh/id_rsa.pub >> .ssh/authorized_keys
rm  ~/id_rsa.pub

Notes:

id_rsa: private key
id_rsa.pub: public key
Configuring Aliases to Servers¶

So that you don't have to long in
1. create a file called config in your ~/.ssh directory

Host dev
HostName 10.0.1.1
User <your_username>

Host stage
HostName 122.100.2.246
User <your_username>

Host prod
HostName 122.100.2.237
User <your_username>

and now you can used

ssh dev

to login
分享到:
评论

相关推荐

    SSH密钥方式登录Linux

    1. **备份私钥**:将本地的私钥文件(位于`C:\Documents and Settings\uplinux\Application Data\SSH\UserKeys`)备份至安全位置,如手机或U盘,并压缩成带密码的压缩包,以防系统重装后的需要。 2. **关闭密码登录...

    SSH_Secure_Shell_ClientH工具密钥登录linux

    使用命令“ssh-keygen -i -f uplinux_key.pub &gt;&gt; authorized_keys”将公钥添加到authorized_keys文件中。然后,我们需要删除生成的文件和authorization文件。 保护密钥 我们的密钥文件非常重要,需要保护好。我们...

    安装和配置github,github.io创建博客

    登录GitHub,进入个人设置(Setting),然后选择左侧菜单的"SSH and GPG keys",添加新的SSH Key,标题自定义,Key粘贴之前复制的内容,最后点击"Add SSH key"。 配置完成后,测试SSH连接是否成功。在Git Bash中...

    Jenkins权威指南.docx

    可编辑的文档,docx格式,便于复制、粘贴、翻译 Foreword . . . . . . . . ....Preface ....Configuring SSH Keys 11 Forking the Sample Repository 12 Starting Up Jenkins 13 Configuring the Tools 17

    Core FTP Server 说明书(EN)

    六、 Setting up secure access Core FTP Server 中的安全访问是通过SSL/TLS 加密来实现的。用户可以设置安全访问密钥,以确保数据传输的安全。 七、 Blocking Access / Access rules Core FTP Server 中的访问...

    RedHat Certificate Engineer

    1. **Setting Up SSH:** - Ensure that the SSH service is installed and running: ```bash sudo yum install openssh-server sudo systemctl start sshd sudo systemctl enable sshd ``` - Edit the SSH ...

    bVNC-Pro-Secure-VNC-Viewer_v4.1.0.apk

    - On-device help on creating a new connection in the Menu when setting up connections - On-device help on available input modes in the Menu when connected - Recommended with Hackers keyboard from ...

    Manning.Git.in.Practice.2014.9.pdf

    - **Setting Up a Git Server**: Set up a server, install Git, and configure the necessary components such as SSH keys for authentication. - **Access Control**: Implement access control using groups and...

    UE(官方下载)

    This is a convenient feature when you're manually comparing files, when you want to copy/paste between multiple files, or when you simply want to divide up your edit space. Tabbed Child Windows ...

    Python Cookbook, 2nd Edition

    Looking up Holidays Automatically Recipe 3.7. Fuzzy Parsing of Dates Recipe 3.8. Checking Whether Daylight Saving Time Is Currently in Effect Recipe 3.9. Converting Time Zones Recipe 3.10. ...

    计算机网络第六版答案

    HFC, rates up to 42.8 Mbps and upstream rates of up to 30.7 Mbps, bandwidth is shared. FTTH: 2-10Mbps upload; 10-20 Mbps download; bandwidth is not shared. 10. There are two popular wireless ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics