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,需要自己手 ...
随机推荐
- LeetCode77:Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 - n. For example, ...
- vim 操作指令2
VIM命令大全 光标控制命令 命令 光标移动 h 向左移一个字符 j 向下移一行 k 向上移一行 l 向右移一个字符 G 移到文件的最后一行 w 移到下一个字的开头 W 移到下一个字的开头,忽略标点符 ...
- HTTPS的学习
HTTPS的学习总结 HTTPS学习总结 简述 HTTPS对比HTTP就多了一个安全层SSL/TLS,具体就是验证服务端的证书和对内容进行加密. 先来看看HTTP和HTTPS的区别 我用AFN访问 ...
- UVA 839 (13.08.20)
Not so Mobile Before being an ubiquous communications gadget, a mobile wasjust a structure made of ...
- [Unity3D]Unity3D发展偷看游戏初期阶段NGUI
朋友,大家晚上好. 我是秦培.欢迎关注我的博客,我的博客地址blog.csdn.net/qinyuanpei.近期博主開始研究NGUI了,由于NGUI是Unity3D中最为流行的界面插件,所以不管从学 ...
- qt button以及label实现不规则图形(五种方法:使用QSS,设置Mask图片,自己画)
1.方法1:准备一张边界是透明的不规则图形 QPushButton * pbtn = new QPushButton; pbtn->setStyleSheet("QPushBut ...
- OCA读书笔记(7) - 管理数据库存储结构
7.Managing Database Storage Structures 逻辑结构 数据库的存储结构有物理结构和逻辑结构组成的 物理结构:物理上,oracle是由一些操作系统文件组成的 SQL&g ...
- 简单概率dp(期望)-zoj-3640-Help Me Escape
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4808 题目大意: 有n条路,选每条路的概率相等,初始能力值为f,每 ...
- 第二章 IoC Setter注入
Setter注入又称为属性注入.是通过属性的setXXX()方法来注入Bean的属性值或依赖对象.由于Setter注入具有可选择性和灵活性高的优点,因此Setter注入是实际应用中最常用的注入方式. ...
- Php 解析XML文件
Php 解析XML文件 Php 解析XML文件,仅供学习參考!演示样例代码例如以下: <?php header("Content-type: text/html; charset=ut ...