设定没有密码的SSH访问方式
2009-09-02 14:32
204 查看
local> ssh-keygen -t dsa -f .ssh/id_dsa
-t tells the type of encription
-f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used
A password will be asked; leave this part blank, just pressing <enter>
Now, go the .ssh directory, and you will find two new files: id_dsa and id_dsa.pub. The last one is the public part. Now, copy the public key to the server machine
local> cd .ssh
local> scp id_dsa.pub user@remote:~/.ssh/id_dsa.pub
Of course, this time you will need to enter the password.
Now, login into the server machine and go to the .ssh directory on the server side
local> ssh user@remote
remote> cd .ssh
Now, add the client's public key to the know public keys on the server
remote> cat id_dsa.pub >> authorized_keys2
remote> chmod 640 authorized_keys2
remote> rm id_dsa.pub
remote> exit
and that's all.
Next time you log into the remote server, no password will be asked.
---------------------------------------------------------------------------------------------------------------------------------------
Sample:
local> ssh-keygen -t dsa -f .ssh/id_dsa
-t tells the type of encription
-f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used
A password will be asked; leave this part blank, just pressing <enter>
Now, go the .ssh directory, and you will find two new files: id_dsa and id_dsa.pub. The last one is the public part. Now, copy the public key to the server machine
local> cd .ssh
local> scp id_dsa.pub root@xxx.xxx.xxx.xxx:~/.ssh/id_dsa.pub
Of course, this time you will need to enter the password.
Now, login into the server machine and go to the .ssh directory on the server side
local> ssh root@xxx.xxx.xxx.xxx
remote> cd .ssh
Now, add the client's public key to the know public keys on the server
remote> cat id_dsa.pub >> authorized_keys2
remote> chmod 640 authorized_keys2
remote> rm id_dsa.pub
remote> exit
-t tells the type of encription
-f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used
A password will be asked; leave this part blank, just pressing <enter>
Now, go the .ssh directory, and you will find two new files: id_dsa and id_dsa.pub. The last one is the public part. Now, copy the public key to the server machine
local> cd .ssh
local> scp id_dsa.pub user@remote:~/.ssh/id_dsa.pub
Of course, this time you will need to enter the password.
Now, login into the server machine and go to the .ssh directory on the server side
local> ssh user@remote
remote> cd .ssh
Now, add the client's public key to the know public keys on the server
remote> cat id_dsa.pub >> authorized_keys2
remote> chmod 640 authorized_keys2
remote> rm id_dsa.pub
remote> exit
and that's all.
Next time you log into the remote server, no password will be asked.
---------------------------------------------------------------------------------------------------------------------------------------
Sample:
local> ssh-keygen -t dsa -f .ssh/id_dsa
-t tells the type of encription
-f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used
A password will be asked; leave this part blank, just pressing <enter>
Now, go the .ssh directory, and you will find two new files: id_dsa and id_dsa.pub. The last one is the public part. Now, copy the public key to the server machine
local> cd .ssh
local> scp id_dsa.pub root@xxx.xxx.xxx.xxx:~/.ssh/id_dsa.pub
Of course, this time you will need to enter the password.
Now, login into the server machine and go to the .ssh directory on the server side
local> ssh root@xxx.xxx.xxx.xxx
remote> cd .ssh
Now, add the client's public key to the know public keys on the server
remote> cat id_dsa.pub >> authorized_keys2
remote> chmod 640 authorized_keys2
remote> rm id_dsa.pub
remote> exit
相关文章推荐
- 宿主机访问容器SSH免密码登录的commit和dockerfile两种方式
- Linux:SSH不需要密码的访问
- SSH整合其他方式(没有hibernate的核心配置文件)
- SSH免密码登录方式
- 不输入密码自动通过 SSH 方式登录服务器
- SSH无密码访问目标服务器
- 当程序用ado的jet4.0方式连接的时候,对于设有access数据库密码的mdb的访问居然报错“无法启动应用程序,工作组信息文件丢失,或是已被其他用户已独占方式打开”,而用odbc方式不报错,小阴沟里翻船,郁闷中然后查文档解决之
- 多台Linux服务器SSH相互访问无需密码
- 访问gitlab从http方式改为ssh方式,gitlab使用的不是标准22端口
- SSH无密码访问
- 设置多台服务器相互ssh无密码访问
- putty绕过ssh认证方式来保存密码
- 易宝典文章——如何设定OWA登录时只使用用户名加密码的方式
- linux配置ssh无密码访问
- 右键TXT文件-打开方式-选择默认程序提示 windows无法访问指定设备,路经或文件.您可能没有合适的权限访问这个项目
- centos下SSH无密码访问(非22端口) .
- linux下实现ssh无密码登录访问
- MFC利用ADO建立access数据源 ---包括访问带access密码与不带access密码两种方式)
- SSH设置不输入密码登陆方式
- github使用(通过webstorm创建一个nodejs项目的本地git库,推送到github进行管理,(ssh密钥无用户密码方式))