Mac 设置ssh登录云服务器
2018-02-23 22:29
246 查看
执行命令 ssh-copy-id root@hostName
出现以下内容:/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/username/.ssh/id_rsa.pub"/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys输入你的密码:root@hostName's password:*******输入完密码后出现以下内容表示添加成功:Number of key(s) added: 1Now try logging into the machine, with: "ssh 'root@hostName'"and check to make sure that only the key(s) you wanted were added.
查看远程服务器上的公钥:
cd .ssh/cat authorized_keys会显示以下秘钥内容:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXmMmJthqSFy33QZ2KrlyXcAPhhhj4QkpoV3qe9fvPILRsn+R4dkf4bqxFqp+Z0yhQrWuEhm+Qcjwx6noikQY+kNDHbB7RrQvCHg9bBBlAleFLmEoh7F9UE8/***************************************************************************************************************
此内容跟本地id_rsa.pub的内容相同说明添加成功。
Mac上设置服务器别名登录远程服务器:进入到 .ssh目录下> vim config按照以下格式添加以下内容# 服务器1Host alias-1 HostName IP Port 22 User root# 服务器2Host alias-2 HostName ip Port 22 User root保存后就可以使用别名登录(> ssh alias-1) 远程与服务器了
出现以下内容:/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/username/.ssh/id_rsa.pub"/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys输入你的密码:root@hostName's password:*******输入完密码后出现以下内容表示添加成功:Number of key(s) added: 1Now try logging into the machine, with: "ssh 'root@hostName'"and check to make sure that only the key(s) you wanted were added.
查看远程服务器上的公钥:
cd .ssh/cat authorized_keys会显示以下秘钥内容:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXmMmJthqSFy33QZ2KrlyXcAPhhhj4QkpoV3qe9fvPILRsn+R4dkf4bqxFqp+Z0yhQrWuEhm+Qcjwx6noikQY+kNDHbB7RrQvCHg9bBBlAleFLmEoh7F9UE8/***************************************************************************************************************
此内容跟本地id_rsa.pub的内容相同说明添加成功。
Mac上设置服务器别名登录远程服务器:进入到 .ssh目录下> vim config按照以下格式添加以下内容# 服务器1Host alias-1 HostName IP Port 22 User root# 服务器2Host alias-2 HostName ip Port 22 User root保存后就可以使用别名登录(> ssh alias-1) 远程与服务器了
相关文章推荐
- 用ssh-keygen来设置ssh无密码登录
- 免认证的ssh登录设置
- 使用ssh-keygen设置ssh无密码登录
- 使用ssh-keygen设置ssh无密码登录
- 【VirtualBox】设置NAT端口映射-SSH登录
- centos6 ssh 设置免密码登录
- 【Xshell】连接【Mac】电脑之ssh设置
- linux系统ssh无密码环境登录设置
- 设置centos7之间ssh无密码登录
- 使用SecureCRT设置linux系统登录的ssh公钥认证
- ubuntu下ssh连接设置无密码登录后依然需要输入密码
- 使用SecureCRT设置linux系统登录的ssh公钥认证
- 设置 ssh 使用public key 免密码登录
- ssh-keygen生成密钥设置方法,让ubuntu无密码登录linux
- MAC OS X 系统设置SSH安全访问
- hadoop中ssh免密码登录设置不成功
- vmware 虚拟机ubuntu设置与securecrt ssh 登录
- Mac上用SSH登录到远程Linux服务器命令
- 【Ubuntu14.04.1】设置root用户ssh登录
- 设置ssh免密码登录