R's Workshop

SSH Login using Hostname and Login without Password

每次 login server 都要打一長串帳號 + IP + port + 密碼打到有點煩. 紀錄一下偷懶的方法: (1) 免打密碼, (2) 使用 hostname 代替 IP address

Login without Password

要準備一組公鑰上傳到 server, 然後用私鑰登入.

Login using Hostname

.ssh/config 加入 server 的資訊, 範例

Host myserver
	HostName 192.168.1.6
	User borting
	Port 22
	PreferredAuthentications publickey
	IdentityFile ~/.ssh/id_rsa

Reference

Linux