当前位置:   article > 正文

折腾开源WRT的AC无线路由之路-5_openwrt 怎么做ac

openwrt 怎么做ac

-在Mac上设置无密码连接SSH

1. 生成SSH密钥对

<pre name="code" class="html">ssh-keygen -t rsa -b 1024 -C "$(whoami)@$(hostname),$(date '+%F %T')" -f ~/.ssh/tomato

 或者简单的: 

ssh-keygen -t rsa -f ~/.ssh/tomato

它会询问设置密语(passphrase),为了安全起见最好给他设定一个密语;如果不要,就回车继续。

然后它生成两个密钥对文件:tomato和tomato.pub

把tomato.pub中的内容复制,或者运行下面命令复制到剪贴板中

LC_CTYPE=UTF-8 pbcopy <~/.ssh/tomato.pub

2. 到Tomato的管理界面:Administration->Admin Access->Authorized Keys

粘贴到Authorized Keys里面:



如果有多个,可以在下面继续粘贴,并保存。


3. 在Mac上设定使用哪个密钥文件.

编辑/生成新的~/.ssh/config文件,内容写入:

  1. Host 192.168.1.1
  2. IdentityFile ~/.ssh/tomato
  3. User root
或者运行命令:

  1. cat <<EOF >> ~/.ssh/config
  2. Host 192.168.1.1
  3. IdentityFile /Users/toliu/.ssh/tomato
  4. User root
  5. EOF

把192.168.1.1替换成你的无限路由的地址。


4. 设定正确的用户和权限,在10.81之后,如果权限和用户不正确,它不会连接成功:

chmod 400 ~/.ssh/tomato;chmod 700 ~/.ssh/


5. 尝试:ssh 192.168.1.1


欧了



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/290804
推荐阅读
  

闽ICP备14008679号