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. php等号(==)与全等(===)

    <?php require_once 'Person.php'; header("content-type:text/html;charset=utf-8"); $perso ...

  2. Servlet的学习之Request请求对象(3)

    本篇接上一篇,将Servlet中的HttpServletRequest对象获取RequestDispatcher对象后能进行的[转发]forward功能和[包含]include功能介绍完. 首先来看R ...

  3. Ubuntu_开启root 登陆

    默认的安装完ubuntu ,root 用户没有开启 1.使用安装时的用户,先给root用户设置密码 设置root密码 sudo passwd root 之后会提示输入新的密码 切换到root用户 su ...

  4. android.graphics包中的一些类的使用

    游戏编程相关参考 Matrix学习系列: http://www.moandroid.com/?p=1781 Android画图学习总结系列: http://www.moandroid.com/?p=7 ...

  5. Oracle 执行计划了的rows概念

    alter session set statistics_level=all; select t1.* from t1,t2 where t1.id=t2.id and t1.id<3; sel ...

  6. [容斥原理] zoj 3556 How Many Sets I

    主题链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do? problemId=4535 How Many Sets I Time Limit: 2 ...

  7. Delphi的VMT的结构图,很清楚

    Every Delphi class is defined internally by its vmt—​its virtual-method table. The vmt contains a li ...

  8. 你真的了解JAVA中与Webservice相关的规范和实现吗?

    非常多人在项目中使用Webservice,仅仅是知道怎样公布Webservice,怎样调用Webservice,但真要论其来龙去脉,还真不一定清楚. 一切一切还要从我们伟大的sun公司规范说起. JA ...

  9. 进一步解 apt-get 的几个命令

    用 apt-get 也非常久了,没多想它的实现,近期遇到 gstreamer 装不上的问题.才多看看了它 apt-get 就是从网上下载包,并安装到本地 手工下载 dpkg 包,而后 "dp ...

  10. Mybatis自己主动生成代码

    在mybatis自己主动生成代码有两种方式: 方式一:是通过使用eclipse作为开发工具.採用maven来构建项目生成的.以下的演示是通过第一种方式. 今天来记录下mybatis-generator ...