ubuntu下ssh使用 与 SCP 使用
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 使用的更多相关文章
- Ubuntu下ssh连接在服务端显示图形界面
Ubuntu下ssh连接在服务端显示图形界面 step1 安装ssh服务 服务端安装运行ssh,在终端运行命令如下: sudo apt-get install openssh-server 在客户端安 ...
- Ubuntu下SSH设置
网上有很多介绍在Ubuntu下开启SSH服务的文章,但大多数介绍的方法测试后都不太理想,均不能实现远程登录到Ubuntu上,最后分析原因是都没有真正开启ssh-server服务.最终成功的方法如下: ...
- Ubuntu下 ssh : connect to host localhost port 22:Connection refused
Ubuntu下测试ssh时使用ssh localhost 命令,出现错误提示connect to host localhost port 22:Connection refused 造成这个错误的原因 ...
- linux下ssh远程登录/scp远程复制文件/rsync远程同步命令的自动登录
最近需要写一个脚本备份各个服务器上的程序到一个指定服务器上,本来以为查查rsync命令的使用321就能搞定,结果rsync命令要支持自动登 录还是要配置服务和参数,又不确定网上说的配置的行不行,因为都 ...
- virtualbox ubuntu下ssh连接
一.首先Ubuntu中安装ssh服务器 Ubuntu 下安装 OpenSSH Server 是无比轻松的一件事情,需要的命令只有一条: sudo apt-get install openssh-ser ...
- Ubuntu下SSH无密码验证配置
前言 SSH为Secure Shell 的缩写,是目前较可靠,专为远程登录会话和其他网络服务提供安全性的协议.越来越多的小伙伴们使用远程登录,而ssh安全性无疑是很高的,那么我们现在来看看如何实现ss ...
- Ubuntu下ssh免password登录安装
1.首先在本机安装openssh-server和openssh-client. 命令:sudo apt-get install openssh-server openssh-client 2.在检查当 ...
- Ubuntu下ssh的安装
1.安装 Ubuntu缺省安装了openssh-client,,如果没有安装,可用apt-get安装上即可. 安装ssh-server sudo apt-get install openssh-ser ...
- [转载]Ubuntu下ssh服务的安装与登陆(ssh远程登陆)
转载地址:http://blog.csdn.net/zht666/article/details/9340633 Ubuntu默认并没有安装ssh服务,如果通过ssh远程连接到Ubuntu,需要自己手 ...
随机推荐
- 核心游记之 page_address_init
lock_kernel()仅仅虚晃一枪就过去了. 紧接着来的是page_address_init include/linux/mm.h #if defined(CONFIG_HIGHMEM) &a ...
- Effective C++_笔记_条款08_别让异常逃离析构函数
(整理自Effctive C++,转载请注明.整理者:华科小涛@http://www.cnblogs.com/hust-ghtao/) C++并不禁止析构函数吐出异常,但它不鼓励你这样做.考虑如下代码 ...
- Mongdb 访问
http://114.55.75.xx/pics/201607040751367d21a38035bd4da7abd4473783f85f7a
- zabbix 主机名必须要能ping通
api01:/home/tomcat> cat /etc/hosts 127.0.0.1 localhost ::1 localhost localhost.localdomain localh ...
- 自己写一个jqery的拖拽插件
说实话,jQuery比原生的js好用多了,本来想用原生写的,也写出来的,仅仅是,感觉不像插件,所以用jQuery实现了一版. 实现的功能:能够指定拖拽的边界,在拖拽过程中,能够触发几个自己定义事件 先 ...
- PowerDesigner反projectM连接ySql没有mySql odbc驱动器
PowerDesignerfang反project连接MySql没有mySql odbc驱动器 需要安装 MySql ODBC驱动器.百度下载mysql-connector-odbc-5.3.4-wi ...
- Swift - 文本输入框内容改变时响应,并获取最新内容
1,问题描述 有时我们开发的时候需要先把“确认”按钮初始设置为不可用,当文本框中输入文字以后,再将输入按钮变为可用. 2,实现原理 (1)要检测文本框内容的变化,我们需要让新界面的Controller ...
- 第十六周oj刷题——Problem J: 填空题:静态成员---计算学生个数
Description 学生类声明已经给出.在主程序中依据输入信息输出实际建立的学生对象个数,以及全部学生对象的成绩总和. Input 学生个数 相应学生个数的学生信息(姓名 年龄 成绩) ...
- MFC的消息机制
MFC的消息循环(::GetMessage,::PeekMessage)消息泵(CWinThread::PumpMessage)和MFC的消息在窗口之间的路由是两件不同的事情 分两个步骤完成: 1 “ ...
- "Invalid username/password or database/scan listener not up"
文档 ID … 11.2 RAC DBconsole Creation Fails With Error: "Invalid username/password or ...