ssh连接可以以用户名和口令的形式来连接也可以采用public key方式来实现客户端的认证。这也就是通常大家所说的免输密码的方式登录。
在实际操作的时候,只需要做很少的工作:
1)在client端使用ssh-keygen命令生成公钥和私钥
2) 拷贝client端的公钥到服务器端,可以使用scp命令
3) 将公钥中的内容写入到服务器的~/.ssh/authorized_keys文件中:cat id_rsa.pub >> ~/.ssh/authorized_keys
正常情况下这样就搞定了,linux比较好玩的就是经常容易发生一些意外的小插曲,解决这些意外的小插曲常常也会带来一些意外的小收获。今天我就又遇上了一段小插曲,一切操作正常,但就是还得输密码,参看各种书籍资料之后终于找到问题了,在这里有解释:http://www.openssh.com/faq.html#3.14
写道
Typically this is caused by the file permissions on $HOME, $HOME/.ssh or $HOME/.ssh/authorized_keys being more permissive than sshd allows by default.
In this case, it can be solved by executing the following on the server.
$ chmod go-w $HOME $HOME/.ssh
$ chmod 600 $HOME/.ssh/authorized_keys $ chown `whoami` $HOME/.ssh/authorized_keys
If this is not possible for some reason, an alternative is to set StrictModes no in sshd_config, however this is not recommended.
我的问题是出在.ssh目录的权限过大,之前是775,chmod -R go-w .ssh之后问题就解决了,不是很能理解为什么权限过大了会有问题,如果权限有问题那也是权限过小时有问题,总之问题解决了并且进一步熟悉了linux对文件权限的管理
分享到:
相关推荐
SSH Secure Shell Client用public key认证登录
ssh通过public_KEY登录20131101.pdf
CentOS利用expect批量推送ssh public key的脚本
NULL 博文链接:https://xls.iteye.com/blog/1446687
一、ssh服务器安装 1).我们使用免费软件freeSSHd。... 2)安装完成后进入配置界面, (1)Server State中确保SSH服务已打开 ...(3)在Authentication界面,确定Public key为Allowed. (4)在Linux客户端ssh配置,参
Public Key认证的基础在于一对密钥,public key和private key,public key对数据进行加密而且只能用于加密,private key 只能对所匹配的public key加密过的数据进行解密。
NULL 博文链接:https://keshion.iteye.com/blog/1037802
github-user-publickey 获取GitHub用户PublicKey 安装 > npm install --save github-user-publickey 用法 var githubUserPublicKey = require ( 'github-user-publickey' ) ; githubUserPublicKey ( cli . input ...
会话认证支持 SSH 自动执行。 支持 SSH ProxyCommand 或 ProxyJump。 支持 SSH 代理转发。 支持使用密码、公钥、键盘交互、gssapi-with-mic 的 SSH 自动登录。 支持 X11 转发。 支持直接/本地端口转发、反向/远程...
Publick Key 认证的基础在于一对密钥,public key和private key ,public key对数据进行加密而且只能用于加密,private key 只能对所匹配的public key加密过的数据进行解密。我们把public key放在远程系统合适的位置...
[Switch] public-key local create rsa The range of public key size is (512 ~ 2048). NOTES: If the key modulus is greater than 512, It will take a few minutes. Press CTRL+C to abort. Input the bits of...
可选择从 PuppetDB 中查找 ssh_public_keys 节点事实 用法 该模块本身非常简单。 您只需要使用定义的类型 ssh::authorized_key 来推出您的密钥。 ssh::authorized_key {"user1:bar@example.org": } ssh::autho
In public key authentication, SSH clients and servers authenticate each other via public/private key pairs. Each must have access to their own private key, and they must have access to each other's ...
You can get a public key‘s fingerprint by running % ssh-keygen -F publickey.pub on the keyfile. Are you sure you want to continue connecting (yes/no)? Yes Host key saved to /home/jsmith/.ssh2/host...
git从入门到高级的图像化教程 从安装git到生成ssh公钥 添加GitHub GitLab 码云SSH等 各种git使用场景
vs2010下实现的SSH上传功能,使用libssh2开源库编译
git clone 出现Permission Denied (publickey)问题,大多数博主建议大家加入公钥,不过加入公钥以后还是有问题。我自己出现的问题有两个: 1、sign_and_send_pubkey: signing failed: agent refused operation 2、...
第一步 重新生成ssh ssh-keygen -t rsa -C “这里需要填写邮箱。我填写的是我的绑定主邮箱。我想其他邮箱也是可以的,只不过我没有测试。” 第二步 查看你生成的公钥 cat ~/.ssh/id_rsa.pub 然后我们就可以看到我们...
Colab SSH 创建SSH Tunel到正在运行的colab笔记本 先决条件 ...setup_ssh ( public_key ) loop_forever () 您可以使用公共密钥或链接列表的原始文本文件authorized_keys像以及 运行它,大约2分钟后,您
terraform-aws-key-pair 用于生成SSH公钥文件或将SSH公钥文件导入AWS的Terraform模块。 该项目是我们针对DevOps的全面方法的一部分。 它是100%开源的,并根据许可。 从字面上看,我们有,... ssh_public_key_path