.ssh证书不信任——在shell中使用scp命令

pmars 2012-12-20 01:46:55

我想再shell脚本里面用到scp去copy日志至另一台服务器,但是我不想总是去数据密码,所以我查了一下如何不用总是输入密码:
http://blog.csdn.net/magicbreaker/article/details/2755648
但是,为什么我按照这个做了,却不好使呢?

还求大婶们多多帮忙!
在此先行谢过!
...全文
235 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ljc007 2012-12-20
  • 打赏
  • 举报
回复
把.ssh文件夹的权限设置为700 把authorized_keys文件的权限设置为600
insulted 2012-12-20
  • 打赏
  • 举报
回复
把当前用户家目录下的.ssh文件夹下的私钥证书id_rsa和公钥证书id_rsa.pub复制到目标机器的相同目录下,第一次scp时候需要输入密码,输入一次,后续就不用了
nevil 2012-12-20
  • 打赏
  • 举报
回复
仔细查看一下id_rsa.pub和远程authorized_keys文件中的内容是否一致
A5下载站向大家介绍一款支持SSH(Secure SHell)的SCP(Secure Copy)文件传输软件——WinSCP 。WinSCP 运行于Windows环境,其主要功能就是在本地与远程计算机间安全的复制文件。软件采用双视窗排列方式,能实现复制、移动、更名文件或文件夹等功能。WinSCP使用方便,速度快,质量高,对于用户来说是一款很不错的软件,小编这里推荐大家使用这款软件!   WinSCP特性 图形用户界面 多语言 与Windows完美集成(拖拽, URL,快捷方式) 支持所有常用文件操作 支持基于SSH-1、SSH-2的SFTP和SCP协议 支持批处理脚本和命令行方式 多种半自动、自动的目录同步方式 内置文本编辑器 支持SSH密码、键盘交互、公钥和Kerberos(GSS) 验证 通过与Pageant(PuTTY Agent)集成支持各种类型公钥验证 提供Windows Explorer与Norton Commander界面 可选地存储会话信息 可将设置存在配置文件而非注册表,适合在移动介质上操作   Winscp操作方法 WinSCP可以执行所有基本的文件操作,例如下载和上传。同时允许为文件和目录重命名、改变属性、建立符号链接和快捷方式。 两种可选界面允许用户管理远程或本地的文件。 连接到远程计算机 使用WinSCP可以连接到一台提供SFTP (SSH File Transfer Protocol)或SCP (Secure Copy Protocol)服务的SSH (Secure Shell)服务器,通常是UNIX服务器。SFTP包含于SSH-2包,SCP在SSH-1包。两种协议都能运行在以后的SSH版本之上。WinSCP同时支持SSH-1和SSH-2。
unlocker208 是使用 VMware 安装 MacOS的必备补丁,亲测可用,详情参阅压缩包内有readme。 VMware 安装 MacOS的流程: =============================================== 1. 安装VMware Station Pro 12.0 2. 将Unlocker解压,右击win-install.cmd,选择“以管理员身份运行” 3. 为MacOS新建虚拟机,注意一定要下载懒人版安装包,格式为ISO或CDR 4. 新建完虚拟机之后,“开启此虚拟机”,VMWare会报错。这是因为虚拟机的隐藏参数设置错误,你要手动修改: 打开虚拟机所在文件夹,找到.vmx文件,右键使用其他程序打开,并选择记事本,在文件最后添加: smc.version = "0" 并保存。 ================================================= Mac OS X Unlocker for VMware V2.0 ================================= 1. Introduction --------------- Unlocker 2 is designed for Workstation 11, Player 7, ESXi 6 and Fusion 7. If you are using an earlier product please continue using Unlocker 1 Version 2 has been tested against: * Workstation 11/12 on Windows and Linux * Player 7 & Workstation Player 12 on Windows and Linux * Fusion 7/8 on Mavericks and Yosemite * ESXi 6.0 The patch code carries out the following modifications dependent on the product being patched: * Fix vmware-vmx and derivatives to allow Mac OS X to boot * Fix vmwarebase .dll or .so to allow Apple to be selected during VM creation * Fix libvmkctl.so on ESXi 6 to allow use with vCenter * Download a copy of the latest VMware Tools for OS X Note that not all products recognise the darwin.iso via install tools menu item. You will have to manually mount the darwin.iso for example on Workstation 11 and Player 7. The vmwarebase code does not need to be patched on OS X or ESXi so you will see a message on those systems telling you that it will not be patched. In all cases make sure VMware is not running, and any background guests have been shutdown. The code is now Python as it makes the Unlocker easier to run and maintain on ESXi. There are some challenges to write the code as ESXi has a subset of Python 2.7 which constrains some modules that can be used. 2. Prerequisites ---------------- The code requires Python 2.7 to work. Most Linux distros, ESXi and OS X ship with a compatible Python interpreter and should work without requiring any additional software. Windows has a packaged version of the Python script using PyInstaller, and so does not require Python to be installed. 3. Limitations -------------- If you are using VMware Player or Workstation on Windows you may get a core dump. Latest Linux and ESXi products are OK and do not show this problem. +-----------------------------------------------------------------------------+ | IMPORTANT: | | ========== | | | | If you create a new VM using version 11 or 12 hardware VMware may stop and | | create a core dump. There are two options to work around this issue: | | | | 1. Change the VM to be HW 10 - this does not affect performance. | | 2. Edit the VMX file and add: | | smc.version = "0" | | | +-----------------------------------------------------------------------------+ 4. Windows ---------- On Windows you will need to either run cmd.exe as Administrator or using Explorer right click on the command file and select "Run as administrator". win-install.cmd - patches VMware win-uninstall.cmd - restores VMware win-update-tools.cmd - retrieves latest OS X guest tools 5. Linux --------- On Linux you will need to be either root or use sudo to run the scripts. You may need to ensure the Linux scripts have execute permissions by running chmod +x against the 2 files. lnx-install.sh - patches VMware lnx-uninstall.sh - restores VMware lnx-update-tools.cmd - retrieves latest OS X guest tools 6. Mac OS X ----------- On Mac OS X you will need to be either root or use sudo to run the scripts. This is really only needed if you want to use client versions of Mac OS X. You may need to ensure the OS X scripts have execute permissions by running chmod +x against the 2 files. osx-install.sh - patches VMware osx-uninstall.sh - restores VMware 7. ESXi ------- You will need to transfer the zip file to the ESXi host either using vSphere client or SCP. Once uploaded you will need to either use the ESXi support console or use SSH to run the commands. Use the unzip command to extract the files. <<>> Please note that you will need to reboot the host for the patches to become active. The patcher is embbedded in a shell script local.sh which is run at boot from /etc/rc.local.d. You may need to ensure the ESXi scripts have execute permissions by running chmod +x against the 2 files. esxi-install.sh - patches VMware esxi-uninstall.sh - restores VMware Note: 1. Any changes you have made to local.sh will be lost. If you have made changes to that file, you will need to merge them into the supplied local.sh file. 2. The unlocker runs at boot time to patch the relevant files and it now survives an upgrade or patch to ESXi as local.sh is part of the persisted local state. 8. Thanks --------- Thanks to Zenith432 for originally building the C++ unlocker and Mac Son of Knife (MSoK) for all the testing and support. Thanks also to Sam B for finding the solution for ESXi 6 and helping me with debugging expertise. Sam also wrote the code for patching ESXi ELF files.
Re: 《文件备份与压缩命令》 ---------------------------------------内容提要: 1/6)tar   命令:打包备份/解压打包(将文件或目录的压缩或不解压查看查看)2/6)gzip  命令:压缩或解压文件3/6)zip   命令:打包和压缩文件4/6)unzip 命令:解压zip文件5/6)scp   命令:远程文件复制(全量备份)6/6)rsync 命令:文件同步工具(增量备份)  本人在教学和实战过程发现,即便是有一定运维经验的人,可能已经能够搭建一定复杂度的Linux架构,但是在来来回回的具体操作,还是体现出CLI(命令界面)功底不够扎实,甚至操作的非常‘拙’、处处露‘怯’。 对一个士兵来说,枪就是他的武器,对于一个程序员来说,各种library(工具库)就是他的武器;而对于Linux运维人员来说,无疑命令行工具CLI(命令界面)就是他们的武器;高手和小白之间的差距往往就体现在对于这些“武器”的掌握和熟练程度上。有时候一个参数就能够解决的事情,小白们可能要写一个复杂的Shell脚本才能搞定,这就是对CLI(命令界面)没有理解参悟透彻导致。 研磨每一个命令就是擦拭手的作战武器,平时不保养不理解,等到作战的时候,一定不能够将手的武器发挥到最好,所以我们要平心、静气和专注,甘坐冷板凳一段时间,才能练就一身非凡的内功! 本教程从实战出发,结合当下流行或最新的Linux(v6/7/8 版本)同时演示,将命令行结合到解决企业实战问题来,体现出教学注重实战的务实精神,希望从事或未来从事运维的同学,能够认真仔细的学完Linux核心命令的整套课程。 本课程系列将逐步推出,看看我教学的进度和您学习的步伐,孰占鳌头! 注:关于教学环境搭建,可以参考本人其它课程系列,本教学就不再赘述! 《参透 VMware 桌面级虚拟化》 《在虚拟机安装模版机(包括应用软件等)》 《SecureCRT 连接 GNS3/Linux 的安全精密工具》

23,125

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧