1 ssh远程登录服务器

ssh username@remote_ip #将username换成自己的用户名,将remote_ip换成远程服务器的ip地址

2 将文件/文件夹从远程服务器拷至本地(scp)

scp
-r username@remote_ip:/home/username/remotefile.txt ./
3 将文件/文件夹从本地拷至远程服务器(scp)

scp
-r
localfile.txt username@remote_ip:/home/username/

4 将文件/文件夹从远程服务器拷至本地(rsync)

rsync
-v -u -a --delete --rsh=ssh –stats
username@remote_ip:/home/username/remotefile.txt .
5 将文件/文件夹从本地拷至远程服务器(rsync)

rsync
-v -u -a --delete --rsh=ssh --stats
localfile.txt username@remote_ip:/home/username/

6 连接远程ssh非22端口的服务器(ssh端口为12345)

ssh
-p 12345
username@remote_ip

7 远程拷贝ssh非22端口的服务器文件(ssh端口为12345)

scp
-P 12345 local_file username@remote_ip:remote_dir

scp
-P 12345 username@remote_ip:remote_file local_dir

scp -o
port=12345 username@remote_ip:remote_file local_dir

scp -P 12345
-r local_dir/.* username@remote_ip:remote_dir

拷贝目录,-r是将目录下的目录递归拷贝。".*"是将隐藏文件也拷贝过去。需要先在远端创建好相应的目录。

sftp用法

sftp
-o port=12345 username@remote_ip:remote_dir

ubuntu下ssh使用 与 SCP 使用的更多相关文章

  1. Ubuntu下ssh连接在服务端显示图形界面

    Ubuntu下ssh连接在服务端显示图形界面 step1 安装ssh服务 服务端安装运行ssh,在终端运行命令如下: sudo apt-get install openssh-server 在客户端安 ...

  2. Ubuntu下SSH设置

    网上有很多介绍在Ubuntu下开启SSH服务的文章,但大多数介绍的方法测试后都不太理想,均不能实现远程登录到Ubuntu上,最后分析原因是都没有真正开启ssh-server服务.最终成功的方法如下: ...

  3. Ubuntu下 ssh : connect to host localhost port 22:Connection refused

    Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...

  4. linux下ssh远程登录/scp远程复制文件/rsync远程同步命令的自动登录

    最近需要写一个脚本备份各个服务器上的程序到一个指定服务器上,本来以为查查rsync命令的使用321就能搞定,结果rsync命令要支持自动登 录还是要配置服务和参数,又不确定网上说的配置的行不行,因为都 ...

  5. virtualbox ubuntu下ssh连接

    一.首先Ubuntu中安装ssh服务器 Ubuntu 下安装 OpenSSH Server 是无比轻松的一件事情,需要的命令只有一条: sudo apt-get install openssh-ser ...

  6. Ubuntu下SSH无密码验证配置

    前言 SSH为Secure Shell 的缩写,是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议.越来越多的小伙伴们使用远程登录,而ssh安全性无疑是很高的,那么我们现在来看看如何实现ss ...

  7. Ubuntu下ssh免password登录安装

    1.首先在本机安装openssh-server和openssh-client. 命令:sudo apt-get install openssh-server openssh-client 2.在检查当 ...

  8. Ubuntu下ssh的安装

    1.安装 Ubuntu缺省安装了openssh-client,,如果没有安装,可用apt-get安装上即可. 安装ssh-server sudo apt-get install openssh-ser ...

  9. [转载]Ubuntu下ssh服务的安装与登陆(ssh远程登陆)

    转载地址:http://blog.csdn.net/zht666/article/details/9340633 Ubuntu默认并没有安装ssh服务,如果通过ssh远程连接到Ubuntu,需要自己手 ...

随机推荐

  1. oracle逗号字符串拼接小工具

    oracle逗号字符串拼接小工具 http://www.zui#dai#ma.com/share/1932670249667584.htm 在使用oracle进行数据查询时,常常需要使用到in语句,如 ...

  2. J2EE开发框架搭建(1) - maven搭建多项目

    怎样使用maven搭建多个项目 1. 创建一个maven project 2. 在frame-parent项目上面点击右键,新建Maven Module 3. 完毕之后再建立一个web项目 4. 依照 ...

  3. 与众不同 windows phone (18) - Device(设备)之加速度传感器, 数字罗盘传感器

    原文:与众不同 windows phone (18) - Device(设备)之加速度传感器, 数字罗盘传感器 [索引页][源码下载] 与众不同 windows phone (18) - Device ...

  4. Linux统计文件/目录数量ls -l | grep "^-" | wc -l匹配开头和结尾

    Linux统计文件数量 ls -l | grep "^-" | wc -l “^-”  一般文件 “^d” 目录文件 shell/vim中^表示开头 cat repatterns ...

  5. python中的中文编码

    我现在编写python代码,有一些内容需要用中文编写,例如注释,一些其它的东西 默认python是不支持中文的,包括两个方面不支持,一是文件编码默认是ansi的,二是虚拟机运行解析脚本时也是非utf的 ...

  6. __NSAutoreleaseNoPool(): ... utoreleased with no pool in place - just leaking

    __NSAutoreleaseNoPool(): ... utoreleased with no pool in place - just leaking 我的平台 mac os 10.6 Xcode ...

  7. ThinkPHP 的模型使用详细介绍--模型的核心(七)

    原文:ThinkPHP 的模型使用详细介绍--模型的核心(七) 注意:本节是ThinkPhp框架对数据操作的核心处理部分 大家还是在这里看清楚可以将其剪切放到代码编辑器中查看 本章节给大家着重介绍模型 ...

  8. sort 使用 tab键 作为 分隔符_人生如梦_百度空间

    sort 使用 tab键 作为 分隔符_人生如梦_百度空间 sort 使用 tab键 作为 分隔符 For some reason "\t" doesn't work right, ...

  9. UML中类图的符号解释

    在UML的定义中,描写叙述类和对象之间的关系,包含下面几种方式:依赖(Dependency).关联(Association).聚合(Aggregation).组合(Composition).泛化(Ge ...

  10. 20.23. xmlrpclib — XML-RPC client access — Python v2.7.5 documentation

    20.23. xmlrpclib — XML-RPC client access — Python v2.7.5 documentation 20.23. xmlrpclib — XML-RPC cl ...