Linux的SSH(Secure Shell Protocol)服务

  在数据传输前,SSH会对需要传输的数据进行加密,保证会话安全与会话中传输数据的安全,SSH客户端还包含一个远程拷贝scp。

1、SSH的结构

SSH服务由服务端软件(openssh)和客户端(SSH、SecureCRT、Xshell)组成,SSH默认使用22端口,SSH服务端是一个守护进程,在后台时刻监听客户端的请求,sshd就是SSH服务端的进程名

补充:(守护进程)

守护进程是一个在后台运行并且不受任何终端控制的进程。Unix操作系统有很多典型的守护进程(其数目根据需要或20—50不等),它们在后台运行,执行不同的管理任务。
用户使守护进程独立于所有终端是因为,在守护进程从一个终端启动的情况下,这同一个终端可能被其他的用户使用。例如,用户从一个终端启动守护进程后退出,然后另外一个人也登录到这个终端。用户不希望后者在使用该终端的过程中,接收到守护进程的任何错误信息。同样,由终端键人的任何信号(例如中断信号)也不应该影响先前在该终端启动的任何守护进程的运行。虽然让服务器后台运行很容易(只要shell命令行以&结尾即可),但用户还应该做些工作,让程序本身能够自动进入后台,且不依赖于任何终端。
守护进程没有控制终端,因此当某些情况发生时,不管是一般的报告性信息,还是需由管理员处理的紧急信息,都需要以某种方式输出。Syslog 函数就是输出这些信息的标准方法,它把信息发送给 syslogd 守护进程。

2、SSH认证类型

(1)基于口令的安全验证,也就是通常所说的账号、密码、端口、IP登录

(2)基于密钥的安全验证

  事先建立一对密钥对,然后将公用的密钥放在服务端,把私有的密钥放在SSH的客户端,最终通过这种密钥验证方式进行加密传输数据。

3、SCP

NAME
     scp - secure copy (remote file copy program)  #安全拷贝

SYNOPSIS
     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[[email protected]]host1:]file1 ... [[[email protected]]host2:]file2

DESCRIPTION
     scp copies files between hosts on a network.(scp是在网络上通过host之间拷贝文件)  It uses ssh(1) for
     data transfer, and uses the same authentication and provides the
     same security as ssh(1).  Unlike rcp(1), scp will ask for pass-
     words or passphrases if they are needed for authentication.

     File names may contain a user and host specification to indicate
     that the file is to be copied to/from that host.  Local file
   names can be made explicit using absolute or relative pathnames
     to avoid scp treating file names containing ‘:’ as host speci-
     fiers.  Copies between two remote hosts are also permitted.

     When copying a source file to a target file which already exists,
     scp will replace the contents of the target file (keeping the
     inode).

     If the target file does not yet exist, an empty file with the
     target file name is created, then filled with the source file
     contents.  No attempt is made at "near-atomic" transfer using
     temporary files.

-P  端口

-p  保持属性

-r  拷贝目录

4、FTP功能服务sftp

上传:

[[email protected] tmp]# sftp -oport=22 [email protected]192.168.181.129
Connecting to 192.168.181.129...
[email protected]192.168.181.129‘s password:
sftp> put /tmp/666 /tmp
stat /tmp/666: No such file or directory
sftp> put /tmp/123.txt /tmp
Uploading /tmp/123.txt to /tmp/123.txt
/tmp/123.txt                                100%    0     0.0KB/s   00:00    

查看上传成功!

下载:

sftp> get /tmp/666 /tmp
Fetching /tmp/666 to /tmp/666
sftp> get /tmp/666 /opt
Fetching /tmp/666 to /opt/666

检查下载到本地成功!

原文地址:https://www.cnblogs.com/caicairui/p/8452686.html

时间: 2024-08-02 19:49:48

Linux的SSH(Secure Shell Protocol)服务的相关文章

Linux学习笔记二:Ubuntu安装SSH(Secure Shell)服务

Ubuntu默认是没有安装SSH(Secure Shell)服务,如果想要通过ssh链接到Ubuntu,我们需要手动安装ssh-server. SSH分客户端ssh-client,服务端ssh-server. 1.判断服务器是否安装ssh服务,可以用如下命令 ssh localhostssh: connect to host localhost port 22: Connection refused  //这个表示还没有安装ssh服务 2.安装命令sudo apt-get install ope

SSH(Secure SHell protocol)服务器

SSH(Secure SHell protocol)服务器:SSH协议预设提供两个服务器功能:1.类似telnet的远程联机使用shell的服务器,亦即是俗称的ssh2.类似FTP服务的sftp-server,提供更安全的FTP服务SSH使用上,主要是利用RSA/DSA/Diffie-Hellman 等机制常见的网络封包加密技术通常是藉由所谓的[非对称密钥系统]来处理:两把不一样的公钥与私钥(Public and Private Key),同一方向的联机中,两把钥匙是需要成对的公钥:提供给远程主

VNCServer,SSH Secure Shell Client,window远程控制linux

1.VNC远程连接linux图形化桌面 2.SSH Secure Shell Client连接linux终端 3.设置FTP与linux传输文件 1.VNC远程连接linux图形化桌面 在centos下运行: yum -y instll vnc vnc-server 运行完后,rpm -q vncserver 却提示:package vncserver is not installed ,不知道什么原因,yum search vnc 发现有好几种版本,选择运行 yum install tiger

利用SSH secure Shell实现windows与linux之间传输文件

在windows下安装SSH secure Shell.默认安装后有两个快捷方式. linux下需要安装openssh-server utuntu默认安装了opens是-client,所以不需要安装,但是如果没有安装的话,再用apt-get install安装即可. 然后确认sshserver服务是否打开 ps -e | grep ssh 如果只有ssh-agent那ssh-server还没有启动,需要/etc/init.d/ssh start,如果看到sshd那说明ssh-server已经启动

配置SSH Secure Shell Client连接Linux

前提 通常,我们在Windows开发是需要远程登录到Linux,常用的远程登录工具有SSH(SSH Secure Shell Client)和SecureCRT等,其中SSH Secure Shell Client免费,推荐使用. 使用SSH(SSH Secure Shell Client)远程登录Linux需要在Linux上安装支持SSH2协议. 在Linux上没安装SSH协议之前,用SSH Secure Shell Client远程登录会提如下: 在Linux上安装SSH协议 本次使用的Li

SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 和oracle 查询数据中文乱码问题

一.SSH Secure Shell Client连接Linux 命令行显示中文乱码问题 linux 设置系统语言 修改 /etc/sysconfig/i18n 文件,如 LANG="en_US.UTF-8",xwindow会显示英文界面, LANG="zh_CN.GB18030",xwindow会显示中文界面. 还有一种方法 cp /etc/sysconfig/i18n $HOME/.i18n 修改 $HOME/.i18n 文件(vim  $HOME/.i18n)

SSH Secure Shell Client安装和使用

SSH是一个用来替代TELNET.FTP以及R命令的工具包,主要是想解决口令在网上明文传输的问题.为了系统安全和用户自身的权益,推广SSH是必要的. SSH是英文Secure Shell的简写形式.通过使用SSH,你可以把所有传输的数据进行加密,这样"中间人"这种攻击方式就不可能实现了,而且也能够防止DNS欺骗和IP欺骗. SSH Secure Shell Client是一款不错的远程linux的工具,下载地址:http://down.51cto.com/data/643694,缺点就

Linux 学习_ssh(secure shell)

ssh(secure shell)是一款集远程操作linux和进行文件上传和下载的软件, 十分好用,在软件公司几乎所有的linux程序员都会使用ssh. 准备工作: 下载地址:http://files.cnblogs.com/hongten/SSHSecureShellClient-3.2.9.zip 下载:SSHSecureShellClient-3.2.9.exe (解压缩后得到的文件) ================================================== 安

SSH Secure Shell Client中文乱码的解决方法

这是SSH Secure Shell Client多年未解决的短板,要求客户端和服务器端都要'UTF-8'编码,Windows中文版的编码是非UTF-8.zh_CN.UTF-8是UTF编码的中文语言环境.Windows使用的是GB2312编码,大多数linux系统支持的是UTF-8编码,而远程登陆时使用的是本地编码,所以会出现乱码的问题:现有几种解决方案: 方案一:修改linux服务器的环境变量 使用linux,在用户根目录下有一个.bash_profile配置文件,该配置只对当前用户有效.若对

Putty、XShell、SecureCRT、SSH Secure Shell Slient哪个好用?

现在大多是用的xshell,因为xshell有一款个人免费的,还是中文界面,对于这种四级都是勉强过的,真心不错.putty因为太小了,所以常常有很多功能不能满足.securecrt在功能上跟xshell(XManager中文版网站)差不多,但是securecrt是英文版的还要收费,所以就果断抛弃了SSH Secure Shell Slient,这款软件使用的不太多,一般使用最多的就是securecrt和xshell了,介于免费的原因,所以推荐使用xshell. 作者:璐璐姐链接:https://