免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1854 | 回复: 5
打印 上一主题 下一主题

在script里用scp [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-15 10:39 |只看该作者 |倒序浏览
请问可以在script里用scp吗?怎样用呢?

论坛徽章:
0
2 [报告]
发表于 2004-06-15 10:48 |只看该作者

在script里用scp

[quote]原帖由 "dewflower"]请问可以在script里用scp吗?怎样用呢?[/quote 发表:

man scp

论坛徽章:
0
3 [报告]
发表于 2004-06-15 15:49 |只看该作者

在script里用scp

楼主的意思可能是怎样才能自动输入密码,关注

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
4 [报告]
发表于 2004-06-16 00:10 |只看该作者

在script里用scp

若 script 解決不了,那就用 ssh 的 RSA/DSA 的驗證來解決,那就不用密碼了...

论坛徽章:
0
5 [报告]
发表于 2004-06-16 02:59 |只看该作者

在script里用scp

好象只能用dsa了. 找到以下的来试试.
HOWTO: set up ssh keys
Paul Keck, 2001

      Getting Started
   1. First, install OpenSSH on two UNIX machines, hurly and burly. This works best using DSA keys and SSH2 by default as far as I can tell. All the other HOWTOs I've seen seem to deal with RSA keys and SSH1, and the instructions not surprisingly fail to work with SSH2.
   2. On each machine type ssh somemachine.example.com and make a connection with your regular password. This will create a .ssh dir in your home directory with the proper perms.
   3. On your primary machine where you want your secret keys to live (let's say hurly), type

      ssh-keygen -t dsa

              This will prompt you for a secret passphrase. If this is your primary identity key, make sure to use a good passphrase. If this works right you will get two files called id_dsa and id_dsa.pub in your .ssh dir. Note: it is possible to just press the enter key when prompted for a passphrase, which will make a key with no passphrase. This is a Bad Idea ™ for an identity key, so don't do it! See below for uses of keys without passphrases.

   4.
      scp ~/.ssh/id_dsa.pub burly:.ssh/authorized_keys2

              Copy the id_dsa.pub file to the other host's .ssh dir with the name authorized_keys2.

   5. Now burly is ready to accept your ssh key. How to tell it which keys to use? The ssh-add command will do it. For a test, type

      ssh-agent sh -c 'ssh-add < /dev/null && bash'

              This will start the ssh-agent, add your default identity(prompting you for your passphrase), and spawn a bash shell. From this new shell you should be able to:

   6.
      ssh burly

              This should let you in without typing a password or passphrase. Hooray! You can ssh and scp all you want from this bash shell and not have to type any password or passphrase.

现在的问题是我用的是SUN的SSH.好象有些不同,他的AUTHENTICATION FILE在哪儿呢?在sshd.confiG里找不到.

论坛徽章:
0
6 [报告]
发表于 2004-06-16 05:03 |只看该作者

在script里用scp

按上面方法,搞定了.谢谢诸位.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP