CentOS安装ssh
最笨的方法:
yum install ssh yum install openssh-server
/etc/init.d/sshd status看sshd服务的状态
/etc/init.d/sshd start开启sshd服务
/etc/init.d/sshd stop关闭sshd服务 开机自启动:
# chkconfig sshd on
# reboot Ubuntu安装SSH
ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu,需要自己手动安装ssh-server。判断是否安装ssh服务,可以通过如下命令进行:
xjj@xjj-desktop:~$ ssh localhost

ssh: connect to host localhost port : Connection refused

如上所示,表示没有还没有安装,可以通过apt安装,命令如下:

-desktop:~$ sudo apt-get install openssh-server  

xjj@xjj-desktop:~$ sudo apt-get install openssh-server

系统将自动进行安装,安装完成以后,先启动服务:

@xjj-desktop:~$ sudo /etc/init.d/ssh start  

xjj@xjj-desktop:~$ sudo /etc/init.d/ssh start

启动后,可以通过如下命令查看服务是否正确启动

@xjj-desktop:~$ ps -e|grep ssh

6212 ?        00:00:00 sshd

xjj@xjj-desktop:~$ ps -e|grep ssh 6212 ? 00:00:00 sshd

如上表示启动ok。注意,ssh默认的端口是22,可以更改端口,更改后先stop,

然后start就可以了。改配置在/etc/ssh/sshd_config下,如下所示。

xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config

# Package generated configuration file

# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for

Port 22

# Package generated configuration file

# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for

Port 22

最后,应该是连接的时候了。请看如下命令:

xjj@xjj-desktop:~$ ssh exceljava@192.168.158.129

xjj@xjj-desktop:~$ vi /etc/ssh/sshd_config

总结:

希望本文介绍的ubuntu下安装使用SSH的方法能够对读者有所帮助,更多有关linux系统的知识还有待于读者去探索和学习。


ssh一般默认是开启的,你可以通过ps aux | grep ssh来看服务有没有开启,通过netstat -tpan | grep 22看下ssh默认的22端口有无开启,如果都开启了还连不上,关闭防火墙service iptables stop就能连了。
 

linux安装ssh(转载)的更多相关文章

  1. Debian 7(Linux) 安装SSH使用SecureCRT连接配置

    1 Debian 安装 ssh2 首先确保你的Debian或者linux安装ssh并开启ssh服务 Debian和ubuntu的安装方法一样,只要源OK的话,可以直接安装 apt-get instal ...

  2. Kali Linux安装SSH Server

    Kali Linux默认并没有安装SSH服务,为了实现远程登录Kali Linux,我们需要安装SSH服务. 安装 OpenSSH Server # apt-get install openssh-s ...

  3. Linux 安装SSH

    ●centOS/redhat安装SSH 查询openssh server服务状态:systemctl status sshd 安装sshd命令: yum install openssh-server ...

  4. linux 安装ssh以及ssh用法与免密登录

    想要免费登录就是把本地机器的id_rsa_pub的内容放到远程服务器的authorized_keys里面 一.配置yum和hosts文件 配置hosts文件: 命令:vi /etc/hosts 在文件 ...

  5. linux 安装SSH Server + FTP Server(openssh-server + vsftp)

    openssh-server (推荐. 一般ssh,ftp 都是单独的,但是这个包含2个) 默认ubuntu 已经安装了, ssh client ,ftp client dpkg -l | grep ...

  6. linux安装ssh服务

    1.安装openssh-server sudo apt-get install openssh-server 2.检查openssh-server是否安装成功 sudo ps -e | grep ss ...

  7. linux 安装weblogic(转载)

    整个过程大同小异,不再笔记,就摘了网上的一篇. 原文地址:http://www.cnblogs.com/walk-the-Line/p/5409094.html 一.安装weblogic10.3.6 ...

  8. 【转】linux下安装ssh服务器端及ssh的安全配置

    一.在服务器上安装ssh的服务器端. $ sudo apt-get install openssh-server 2. 启动ssh-server. $ /etc/init.d/sshrestart 3 ...

  9. Kali Linux上安装SSH服务

    安装 SSH 从终端使用 apt-get 命令安装 SSH 包: # apt-get update # apt-get install ssh 启用和开始使用 SSH 为了确保安全 shell 能够使 ...

随机推荐

  1. [SDOI2011] 消防 (树的直径,尺取法)

    题目链接 Solution 同 \(NOIP2007\) 树网的核 . 令 \(dist_u\) 为以 \(u\) 为根节点的子树中与 \(u\) 的最大距离. \(~~~~dis_u\) 为 \(u ...

  2. win install pip

    在windows下,我们使用python时,常常因为找不到需要的pthon模块,导致一些脚本不能正常执行,这时候可以安装pip工具,使用它来管理安装python所需要的模块: pip install ...

  3. jrebel 激活

    jrebel idea插件激活,亲测可用: 在jrebel server处,写上: http://139.199.89.239:1008/88414687-3b91-4286-89ba-2dc813b ...

  4. 学习javascript设计模式之中介者模式

    1.中介者模式的作用就是解除对象与对象之间的紧耦合关系.增加一个中介者对象后,所有的相关对象都通过中介者来通信,而不是互相引用,所以当一个对象发生改变时,只需要通知中介对象即可.中介者使各对象之间耦合 ...

  5. 转 Perl函数返回值用法指导

    http://developer.51cto.com/art/201007/213003.htm Perl函数返回值用法指导   Perl编程语言中Perl函数返回值用法你是否比较熟悉,这里向大家简单 ...

  6. [TL-WR845N V4] 无线桥接(WDS)设置 + 迅捷桥接配置

    官方文章转载备忘: http://service.tp-link.com.cn/detail_article_697.html?spm=a220o.1000855.0.0.eTMbmU 迅捷桥接配置: ...

  7. WEB学习-CSS行高、字体,链接的美化以及背景

    行高和字号 CSS中,所有的行,都有行高.盒模型的padding,绝对不是直接作用在文字上的,而是作用在“行”上的. 单行文本垂直居中 文本在行里面是居中 其中,行高:盒子高; 需要注意的是,这个小技 ...

  8. 使用KNN对iris数据集进行分类——python

    filename='g:\data\iris.csv' lines=fr.readlines()Mat=zeros((len(lines),4))irisLabels=[]index=0for lin ...

  9. BZOJ——1601: [Usaco2008 Oct]灌水

    http://www.lydsy.com/JudgeOnline/problem.php?id=1601 Time Limit: 5 Sec  Memory Limit: 162 MBSubmit:  ...

  10. SQLite的sqlite_sequence表

    SQLite的sqlite_sequence表   sqlite_sequence表也是SQLite的系统表.该表用来保存其他表的RowID的最大值.数据库被创建时,sqlite_sequence表会 ...