Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Configuring the remote Linux server SSH key authentication to automatically login in Mac OS X     - MongoDB Installation under CentOS 6.6 (Database)

- Talk about jsonp (Programming)

- Java garbage collection (Programming)

- Ubuntu Live CD by updating Grub resume boot the Boot Menu (Linux)

- Java String type time compare the size (Programming)

- C / C ++ various data types Conversion Summary (Programming)

- Detailed use Zabbix monitoring Nginx (Server)

- Debian (Wheezy) Install Java environment / replace OpenJDK as the SUN JDK (Linux)

- C # DateTime structure common method (Programming)

- ActiveMQ-based shared file system HA solutions (Server)

- ORA-01839 error caused by incorrect system date setting (Database)

- To share Internet access through NAT mode under Virtual Linux VMware Workstation (Linux)

- Compression software on a simple comparison of zip and gz (Linux)

- open V switch port mirror in OpenStack neutron (Server)

- Python Flask environment to build (Linux)

- Based on Python: OpenCV simple image manipulation (Programming)

- Iptables in Ubuntu (Linux)

- CentOS iptables firewall enabled (Linux)

- Linux System Getting Started Tutorial: Linux file permissions brief description (Linux)

- Oracle 11g on Linux system boot from the startup settings (Database)

 
         
  Configuring the remote Linux server SSH key authentication to automatically login in Mac OS X
     
  Add Date : 2017-01-08      
         
         
         
  1. Create a public local machine

Open the universal terminal, execute the following command, ignore all output, all the way to happily enter.

ssh-keygen -t rsa -C 'your email@domain.com'
-t Specifies the key type, the default that is rsa, may be omitted
-C Comment text settings, such as your e-mail

2. Copy the public key to the ssh server

The public ~ / id_rsa.pub file generated by the previous step, copied to the ssh server corresponding to the user under the ~ / .ssh / authorized_keys file, you can have a variety of ways, here only three commonly used.

[For osx system] use ssh-copy-id-for-OSX tool to copy the public key to the ssh server
brew install ssh-copy-id
ssh-copy-id username @ hostname # username and hostname will be replaced by your ssh server user name and IP
Use this mode when the user directory under ssh server username yet .ssh directory
cat ~ / .ssh / id_rsa.pub | ssh username @ hostname "mkdir ~ / .ssh; cat >> ~ / .ssh / authorized_keys"
General Information
scp ~ / .ssh / id_rsa.pub username @ hostname: ~ / # to copy the public key file to the ssh server
ssh username @ hostname # username and password to log in to the ssh server
mkdir .ssh # If the .ssh directory already exists, this step can be omitted
cat id_rsa.pub >> .ssh / authorized_keys # public key file id_rsa.pub file content is appended to the authorized_keys file
3. Quick Login

After completing the above steps, you can use the following command to log ssh server, my mother no longer have to worry about you can not remember your password

ssh username @ hostname # username will replace your ssh server user name, hostname replace server ip
However, each still need to enter ssh username @ hostname, still not really the best solution, if you can achieve a key or a login command to log the best, however, let's look at all those solutions

ssh itself also provides a quick way to solve this problem, to the ~ / .ssh / config configuration file to add the information to your ssh server
vim ~ / .ssh / config # Without this file, you can direct new
Add the contents of the file format is as follows:

Host alias # custom aliases
    HostName hostname # replace your ssh server ip or domain
    Port port #ssh server port, default is 22
    User user #ssh server user name
    Private key file IdentityFile ~ / .ssh / id_rsa # The first step of generating a public key corresponding to the file
After you save the file exit, you can use an alias to log ssh server

ssh alias #alias alias you in ~ / .ssh / config configuration file
If you need to configure multiple ssh account, as long as ~ / .ssh / config blank lines to write, as follows:

Host foo
    HostName 192.168.2.222
    Port 22
    User test
    IdentityFile ~ / .ssh / id_rsa

Host alias
    HostName hostname
    Port port
    User user
If you are using a local terminal zsh, it would be too simple, however, and directly to zsh add an alias
echo "alias ssh-to-username = 'ssh username @ hostname'" >> ~ / .zshrc # will be replaced by your username and hostname of the server information
source ~ / .zshrc # reload zshrc changed files
ssh-to-username # using aliases, a command to log in to your ssh server
If you are using a local terminal iterm2 Profile can also be added to achieve a key log on, skip specific steps here
     
         
         
         
  More:      
 
- Linux Workstation Security Checklist - from the Linux Foundation Internal (Linux)
- RHEL5.x RHEL6.x replace CentOS yum source (Linux)
- Cacti installation deployment under CentOS 6.6 (Server)
- How to monitor Nginx (Database)
- Apache POI Excel Document Processing (Linux)
- To setup the Swift language learning environment under linux (Linux)
- Terminal fun: 6 interesting Linux command-line tools (Linux)
- Oracle 10g in the unique and index problems (Database)
- Manually compile Hadoop 2.6.0 under Ubuntu 14.04 (Server)
- Postfix mail service system principle and configuration (Linux)
- Introduction and use of the Raspberry Pi (Linux)
- CentOS7 install and configure Nagios (Server)
- How to use SHA256 checksum files download (Linux)
- The array of C language (Programming)
- Security implementation of disk data protection under Linux (Linux)
- How to create a secure and easy to remember password (Linux)
- ORA-600 [kcbz_check_objd_typ] Error Handling (Database)
- Snort build a secure Linux server (Linux)
- Sniffer install applications in Linux supplement (Linux)
- Install Ubuntu open source drawing program MyPaint 1.2.0 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.