转载地址:http://blog.csdn.net/zht666/article/details/9340633

Ubuntu默认并没有安装ssh服务,如果通过ssh远程连接到Ubuntu,需要自己手动安装ssh-server。
判断是否安装ssh服务,可以通过如下命令进行:
ps -e|grep ssh
输出如下:
zht@zht-Ubuntu:~$ ps -e|grep ssh
 2151 ?        00:00:00 ssh-agent

5313 ?        00:00:00 sshd

ssh-agent表示ssh-client启动,sshd表示ssh-server启动了。

如果缺少sshd,说明ssh服务没有启动或者没有安装。
安装ssh-client命令:sudo apt-get install openssh-client

安装ssh-server命令:sudo apt-get install openssh-server

安装完成以后,先启动服务:sudo /etc/init.d/ssh start
启动后,可以通过“ps -e|grep ssh”查看是否正确启动。

ssh服务默认的端口是22,可以更改端口,使用如下命令打开ssh配置文件:
sudo gedit /etc/ssh/sshd_config

配置文件内容如下:

  1. # Package generated configuration file
  2. # See the sshd(8) manpage for details
  3. # What ports, IPs and protocols we listen for
  4. Port 22
  5. # Package generated configuration file
  6. # See the sshd(8) manpage for details
  7. # What ports, IPs and protocols we listen for

修改端口号(Port)后,重启ssh服务即可生效,命令如下:
sudo /etc/init.d/ssh restart

ssh服务启动后,即可登陆,登陆命令格式为:ssh 帐号@IP地址
例如:ssh test@192.168.135.249
根据提示输入test的密码,即可远程登陆。

退出远程登陆命令:exit

演示如下图所示:

[转载]Ubuntu下ssh服务的安装与登陆(ssh远程登陆)的更多相关文章

  1. 转载:Ubuntu下deb包的安装方法

    转载:Ubuntu下deb包的安装方法,http://blog.csdn.net/kevinhg/article/details/5934462 deb是debian linus的安装格式,跟red ...

  2. Ubuntu 下 firebird 数据库的安装和配置

    Ubuntu 下 firebird 数据库的安装和配置 1.简介 本文主要是 Ubuntu 下 firebird 数据库的安装和目录迁移,同样适用于 Debian 系统:Ubuntu 20.0.4 f ...

  3. Ubuntu 下 Mariadb 数据库的安装和目录迁移

    Ubuntu 下 Mariadb 数据库的安装和目录迁移 1.简介 本文主要是 Ubuntu 下 Mariadb 数据库的安装和目录迁移,同样适用于 Debian 系统:Ubuntu 20.0.4 M ...

  4. Ubuntu下deb包的安装方法 (zz)

    Ubuntu下deb包的安装方法 分类: Ubuntu10使用技巧 2010-10-11 23:49 42969人阅读 评论(3) 收藏 举报 ubuntudebdebianlinux deb是deb ...

  5. ubuntu下deb包的安装方法

    ubuntu下deb包的安装方法 简介 deb是debian linus的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb dpkg 是Debian P ...

  6. UBUNTU下Y86模拟器的安装和使用

    UBUNTU下Y86模拟器的安装和使用 由于上周在虚拟机中安装Y86模拟器中出现了一些问题并且没得到解决,所以上周实验是在实验楼上做的,这几天练习了UBUNTU下Y86模拟器的安装和使用. 参考博客: ...

  7. 腾讯云ubuntu下mysqli服务的开启

    腾讯云ubuntu下mysqli服务的开启 今天晚上搞了好久,在本地操作系统deepin下操作完全无需开启mysqli模块,自动就开启了.这次介绍一下服务器ubuntu下mysqli模块的开启. 首先 ...

  8. Opencv 2.4.9在Ubuntu下的配置与安装

    [原]Opencv 2.4.9在Ubuntu下的配置安装  Opencv 2.4.9在Ubuntu下的配置与安装 surgewong@gmail.com http://blog.csdn.net/su ...

  9. ubuntu下opencv2.4.9安装测试

    ubuntu下opencv2.4.9安装测试 whowhoha@outlook.com 一.依赖包安装 1.  build-essential 软件包 sudo apt-get install bui ...

  10. 【转】Ubuntu下deb包的安装方法

    [转]Ubuntu下deb包的安装方法 deb是debian linus的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb dpkg 是Debian P ...

随机推荐

  1. 20145210姚思羽《网络对抗》MSF基础应用实验

    20145210姚思羽<网络对抗>MSF基础应用实验 实验后回答问题 1.用自己的话解释什么是exploit,payload,encode. exploit就是进行攻击的那一步 paylo ...

  2. centOS最小化安装后网络连接问题

    编辑配置文件 vi /etc/sysconfig/network-script/ifcfg-eth0   修改此行重启后即可 ONBOOT="yes"           #修改为 ...

  3. input ajax自动补全

    页面 <div class="manage-Car-add-info-sn"> <p style="width:25%; height:70%;floa ...

  4. 经典的MapReduce1中的失败

    经典的MapReduce1中的失败在MapReduce1运行时,主要考虑三种失败的模式,运行任务失败.tasktracker失败以及jobtracker失败1. 任务运行失败首先考虑子任务失败的情况. ...

  5. Yum 命令语法

    一.Yum 命令格式: yum <options> <command><package...> 二.参数说明 1.options: 1)-y:如果在工作过程中如要使 ...

  6. codeforces763C

    解题报告: 直接截图好了...辣鸡博客园不能上传文件

  7. 0.00-050613_Makefile

    # Makefile for the simple example kernel. AS86 =as86 -0 -a LD86 =ld86 -0 AS =gas LD =gld LDFLAGS =-s ...

  8. Ceilometer Polling Performance Improvement

    Ceilometer的数据采集agent会定期对nova/keystone/neutron/cinder等服务调用其API的获取信息,默认是20秒一次, # Polling interval for ...

  9. Tensorflow搭建神经网络及使用Tensorboard进行可视化

    创建神经网络模型 1.构建神经网络结构,并进行模型训练 import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt ...

  10. review29

    数组流 流的源和目的地除了可以是文件外,还可以是计算机内存. 1.字节数组流 字节数组输入流ByteArrayInputStream和字节数组输出流ByteArrayOutputStream分别使用字 ...