ssh配置

复制ssh-key
1、复制ssh文件夹到~/.ssh

#如果~/.ssh目录不存在
cp  -r  path/to/ssh  ~/.ssh
#如果~/.ssh目录已存在
cp  -r  path/to/ssh/.  ~/.ssh

2、修改文件权限

chmod 755 ~/.ssh/  
chmod 600 ~/.ssh/id_rsa ~/.ssh/id_rsa.pub   
chmod 644 ~/.ssh/known_hosts 

生成ssh-key

ssh-keygen -t rsa  #一路回车

ssh无密码登陆

cd ~/.ssh
cat id_rsa.pub >> authorized_keys
chmod 600 authorized_keys

开启远程登陆

ssh localhost
//ssh: connect to host localhost port 22: Connection refused
sudo systemsetup -f -setremotelogin on

你可能感兴趣的:(大数据,环境搭建,linux)