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
分享到:
相关推荐
sap ep Setting Up Your SAP Enterprise Portal System Landscape
cognos Setting Up Auditing 实例
Setting up ARIS webMethods integration.pdf
Setting Up Usage Tracking in Oracle BIEE
基于虚拟机的网络搭建视频,基于虚拟机的网络搭建视频,基于虚拟机的网络搭建视频基于虚拟机的网络搭建视频基于虚拟机的网络搭建视频基于虚拟机的网络搭建视频基于虚拟机的网络搭建视频基于虚拟机的网络搭建视频基于...
Oracle Solaris 11.3 Setting Up the Application Development Envir
AFF C190 - Installing and setting up.pdf
AFF A800 - Installing and setting up.pdf
01 2D Animation Tutorial - Setting Up Flash.srt
Oracle Solaris 11.2 Setting Up the Application Development Environment in Oracle Solaris 11-14
Setting Up TMS320 DSP Interrupts in C dsp的中断参数设置
CIMCO Setting up a 4th axis machine.mkv
Setting Up LAMP Getting Linux Apache MySQL and PHP Working Together 2004
Step-by-Step Guide for Setting Up Secure Wireless Access in a Test Lab. Step-by-Step Guide for Setting Up Secure Wireless Access in a Test Lab.
AFF A220 and FAS2700 - Installing and setting up.pdf
Setting up FreeRTOS from scratch on STM32F407 Discovery
Gprs dial up setting
STK-Disk913x-Setting Up a Digital UNIX Server for a 913x OPENsto
STK-Disk913x-Setting Up and NCR MPP-RAS Server for a 913X OPEN