当前位置: 首页 > news >正文

4.1进行网站建设与推广网站蓝色和红色搭配

4.1进行网站建设与推广,网站蓝色和红色搭配,商贸公司网站建设方案,简单的美食网站模板免费下载Linux基础命令-seq打印数字序列 前言 有时候不可避免的需要将文件复制到另外一台服务器上#xff0c;那么这时就可以使用scp命令远程拷贝文件#xff0c;scp命令是基于SSH协议#xff0c;在复制的过程中数据都是加密过的#xff0c;会比明文传输更为安全。 一.命令介绍 …Linux基础命令-seq打印数字序列 前言 有时候不可避免的需要将文件复制到另外一台服务器上那么这时就可以使用scp命令远程拷贝文件scp命令是基于SSH协议在复制的过程中数据都是加密过的会比明文传输更为安全。 一.命令介绍 依旧惯例先到scp的帮助文档中查看命令的概述 NAMEscp — secure copy (remote file copy program) DESCRIPTIONscp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the sameauthentication and provides the same security as ssh(1). scp will ask for passwords or passphrases ifthey are needed for authentication.File names may contain a user and host specification to indicate that the file is to be copied to/fromthat host. Local file names can be made explicit using absolute or relative pathnames to avoid scptreating file names containing ‘:’ as host specifiers. Copies between two remote hosts are also per‐mitted.scp(secure copy)命令主要功能是用来远程拷贝文件可以在多台Linux系统之间复制文件或目录有些类似于cp命令的功能但复制的范围是网络上的另一台主机。 二. 命令语法 scp命令语法格式scp 参数 文件 SYNOPSISscp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port][-S program] [[user]host1:]file1 ... [[user]host2:]file2三. 常用参数 文档中一共有这么多的参数总结一些比较常用的 -1 Forces scp to use protocol 1.-2 Forces scp to use protocol 2.-3 Copies between two remote hosts are transferred through the local host. Without this optionthe data is copied directly between the two remote hosts. Note that this option disables theprogress meter.-4 Forces scp to use IPv4 addresses only.-6 Forces scp to use IPv6 addresses only.-B Selects batch mode (prevents asking for passwords or passphrases).-C Compression enable. Passes the -C flag to ssh(1) to enable compression.-c cipherSelects the cipher to use for encrypting the data transfer. This option is directly passed tossh(1).-F ssh_configSpecifies an alternative per-user configuration file for ssh. This option is directly passedto ssh(1).-i identity_fileSelects the file from which the identity (private key) for public key authentication is read.This option is directly passed to ssh(1).-l limitLimits the used bandwidth, specified in Kbit/s.-o ssh_optionCan be used to pass options to ssh in the format used in ssh_config(5). This is useful forspecifying options for which there is no separate scp command-line flag. For full details ofthe options listed below, and their possible values, see ssh_config(5).AddressFamilyBatchModeBindAddressCanonicalDomainsCanonicalizeFallbackLocalCanonicalizeHostnameCanonicalizeMaxDotsCanonicalizePermittedCNAMEsCertificateFileChallengeResponseAuthenticationCheckHostIPCipherCiphersCompressionCompressionLevelConnectionAttemptsConnectTimeoutControlMaster-2 Forces scp to use protocol 2.-3 Copies between two remote hosts are transferred through the local host. Without this optionthe data is copied directly between the two remote hosts. Note that this option disables theprogress meter.-4 Forces scp to use IPv4 addresses only.-6 Forces scp to use IPv6 addresses only.-B Selects batch mode (prevents asking for passwords or passphrases).-C Compression enable. Passes the -C flag to ssh(1) to enable compression.-c cipherSelects the cipher to use for encrypting the data transfer. This option is directly passed tossh(1).-F ssh_configSpecifies an alternative per-user configuration file for ssh. This option is directly passedto ssh(1).-i identity_fileSelects the file from which the identity (private key) for public key authentication is read.This option is directly passed to ssh(1).-l limitLimits the used bandwidth, specified in Kbit/s.-o ssh_optionCan be used to pass options to ssh in the format used in ssh_config(5). This is useful forspecifying options for which there is no separate scp command-line flag. For full details ofthe options listed below, and their possible values, see ssh_config(5).常用参数 命令选项含义-1使用ssh协议版本1-2使用ssh协议版本2-4使用ipv46使用ipv6-B以批处理模式运行-C使用压缩-F指定ssh配置文件-l指定带宽限制-o指定使用的ssh选项-P指定远程主机的端口号-p保留文件的修改时间访问时间和权限模式-q不显示复制进度-r以递归的方式进行复制 四. 参考实例 4.1 从本地远程复制到另一台服务器 4.1.1 拷贝文件到远程服务器 命令格式 拷贝文件 第一种方式指定用户名将文件远程拷贝到另外一台服务器的目录下命令执行后再输入密码。 scp local_file remote_usernameremote_ip:remote_folder 第二种方式指定用户名将文件远程拷贝到另外一台服务器下文件可以修改成其他名字相当于远程拷贝重命名命令执行后在输入密码。 scp local_file remote_usernameremote_ip:remote_file 第三种方式不指定用户名将文件远程拷贝到另外一台服务器的目录下命令执行后需要输入用户名和密码 scp local_file remote_ip:remote_folder 第四种方式不指定用户名将文件远程拷贝到另外一台服务器下文件可以修改成其他名字相当于远程拷贝重命名命令执行后在输入密码。 scp local_file remote_ip:remote_file 案例演示 scp /usr/local/nginx/conf/nginx.conf root192.168.45.128:/usr/local/nginx/confscp /usr/local/nginx/conf/nginx.conf root192.168.45.128:/usr/local/nginx/conf/nginx.conf.backupscp /usr/local/nginx/conf/nginx.conf 192.168.45.128:/usr/local/nginx/confscp /usr/local/nginx/conf/nginx.conf 192.168.45.128:/usr/local/nginx/conf.backup4.1.2 拷贝目录到远程服务器 命令格式 拷贝目录 第一种方式指定用户名将目录远程拷贝到另外一台服务器的指定目录下需要使用-r参数表示递归操作命令执行后再输入密码 scp -r local_folder remote_usernameremote_ip:remote_folder 第二种方式不指定用户名将目录远程拷贝到另外一台服务器的指定目录下需要使用-r参数表示递归操作命令执行后再输入密码 scp -r local_folder remote_ip:remote_folder 案例演示 scp -r /tmp/ root192.168.45.128:/ scp -r /tmp/ 192.168.45.128:/4.2 从远程复制到本地服务器 从 远程复制到本地只要将从本地复制到远程的命令的后2个参数 调换顺序即可一起来看下。 4.2.1 远程服务器的文件拷贝到本地 第一种方式指定远程用户名指定IP:要复制的文件到./这里./表示将远程服务器上的文件拷贝到本地服务器的当前路径。 scp remote_usernameremote_ip:remote_file ./ 第二种方式指定远程用户名指定IP:要复制的文件到本地服务器指定用户名指定目录等 scp remote_usernameremote_ip:remote_file local_usernamelocal_ip:local_folder 案例演示 scp root192.168.45.128:/usr/local/nginx/conf/nginx.conf /usr/local/conf/ scp -r root192.168.45.128:/usr/local/nginx/ root192.168.45.166:/usr/local/当然也可以拷贝目录方法还是一样在前面加-r参数这里就不再演示。 除了可以选择IP来拷贝文件还可以使用主机名进行拷贝前提需要先将hostname做hosts映射。 cat /etc/hosts 192.168.45.166 localhost166 192.168.45.128 localhost128scp -r rootlocalhost128:/usr/local/nginx/ rootlocalhost166:/usr/local总结 scp命令也是经常会需要用到的只需要了解从本地到远程或从远程到本地的是如何使用即可若觉得以上内容还行可以点赞支持一下
http://www.dnsts.com.cn/news/156721.html

相关文章:

  • 网站咋做推广展厅设计素材网站
  • 手机网站设计公司立找亿企邦创建网站代码
  • 做网站的服务器哪个系统好网站服务器的作用和功能有哪些
  • 国展网站建设做u盘的老外网站
  • 自己怎么做微网站科技园
  • 流媒体网站开发教程wordpress 分页数
  • 安溪网站制作劳务工程信息平台
  • ?]后台的网站可以备案吗北京企业名录大全
  • 网站备案幕布psd制作网站费用分类
  • 公司做网站需要准备什么东西衡阳百度推广公司
  • 易语言做网站后端无锡招聘网最新招聘
  • 开一家网络公司做网站前景如何网页图片加载慢解决方法
  • 网站开发服务费会计处理青海农业网站建设公司
  • 早晨设计 做网站设计吗企业信用信息公示查询
  • 给一个学校网站做宣传海报网站怎么做百度认证
  • 网站在建设中 英语公司网站建设注册
  • 微信公众号是在哪个网站做的最好的完全免费开源企业网站
  • 付费电影网站源码西安网站制作顶尖公
  • 一级a做爰小说免费网站高质量网站外链建设大揭秘
  • 网站轮播效果网站版权 备案icp
  • wordpress一键建站企业网络费用一年多少钱
  • 网站中文模板sem专业培训公司
  • 手机版网站源码垂直电商网站有哪些
  • 搭建自己的网站需要什么创建网站基本步骤
  • 学网站建设有前途吗少儿培训
  • h5商城网站是什么中小企业网站制作费用
  • 大学网站栏目建设通知网站手机版开发
  • 免费h5游戏制作平台潍坊seo建站
  • 深圳网站关键词排名优化做乒乓球网站的图片
  • 网站建设前端学什么语言泉州建设网站