[Linux] Enable ssh key authentication from one user on client to multiple users on server
2015-11-24 22:22
603 查看
Today, I’m trying to setup ssh key authentication, so I can ssh into my server without typing password.
What caught me is that I can’t get key authentication working for the non-root user on server.
For example, I have user
I googled it and found the reference here
To sum it up:
On client machine, generate key-pair
Copy the content of
On server machine, modify
THIS STEP IS VERY IMPORTANT!!!
Make sure file permissions on a user’s
On server machine,
What caught me is that I can’t get key authentication working for the non-root user on server.
For example, I have user
clienton my client and user
serverand
rooton my server.
client@client # ssh server@server client@client # ssh root@server
I googled it and found the reference here
To sum it up:
On client machine, generate key-pair
ssh-keygen -t rsa
Copy the content of
.ssh/id_rsa.pubto
/root/.ssh/authorized_keysand
/home/server/.ssh/authorized_keys
On server machine, modify
/etc/ssh/sshd_config, uncomment
RSAAuthentication yes PubkeyAuthentication yes
THIS STEP IS VERY IMPORTANT!!!
Make sure file permissions on a user’s
/home/server/.sshdirectory must be
700, and the
/home/server/.ssh/authorized_keysmust be
600
On server machine,
systemctl restart sshd
相关文章推荐
- Linux 非缓冲I/O与缓冲I/O
- Centos的管理工具---Security_FX 中文乱码处理
- awk学习
- CentOS Linux 监控安装之cacti
- linux文件按最新时间排序
- linux下用rpm 安装jdk
- 内核阅读笔记之浅析Linux2.6.34内核桥接数据转发(一)
- 成为一名嵌入式Linux开发工程师需要学习哪些知识?
- Linux Network Device Name issue
- linux下利用系统函数实现rm -rf的功能!
- Linux下Vsftp配置及详解
- Linux进程冻结技术
- Linux/Cent OS 6.5 编译,安装obfuscator-llvm-3.6.1
- Linux重定向:将标准输出stdout和标准错误stderr重定向到一个文件
- rhel-server-7.1更换yum源(CentOS7)
- Linux命令集锦
- 编写linux静态库
- CentOS Linux 上安装svn服务器
- Linux学习笔记4
- Linux 常用命令