zoukankan      html  css  js  c++  java
  • 【转】fedora和ubuntu开启ssh

    fedora和ubuntu开启ssh

    1小时前

      ubuntu开启SSH服务

      SSH分客户端openssh-client和openssh-server如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-serversudo apt-get install openssh-server然后确认sshserver是否启动了:ps -e |grep ssh如果看到sshd那说明ssh-server已经启动了。如果没有则可以这样启动:sudo /etc/init.d/ssh startssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。然后重启SSH服务:sudo /etc/init.d/ssh stopsudo /etc/init.d/ssh start然后使用以下方式登陆SSH:ssh tuns@192.168.0.100 tuns为192.168.0.100机器上的用户,需要输入密码。断开连接:exit

      Fedora开启SSH服务

      1) 安装openssh-server

      [root@localhost ~]# yum install openssh-server

      2) 查看是否已成功安装openssh-server

      [root@localhost ~]# rpm -qa | grep openssh-server

      openssh-server-5.3p1-19.fc12.i686

      [root@localhost ~]#

      3) 修改ssh服务的配置文件

      配置ssh服务的运行参数, 是通过修改配置文件/etc/ssh/ssh_config实现的. /etc/ssh/ssh_config文件的配置选项非常多, 但大部分都已经用"#"注释掉了.

      #Port 22

      #Protocol 2,1

      #PermitRootLogin yes

      配置完保存配置文件, 不过如果没什么特殊的要求这都不用配置.

      4) 重启SSH服务

      [root@localhost ~]# /etc/rc.d/init.d/sshd restart

      Stopping sshd: [ OK ]

      Starting sshd: [ OK ]

      5) 如果开启了防火墙, 我们需要允许TCP协议的22端口通过.

      [root@localhost ~]# iptables -I INPUT -p tcp --dport 22 -j ACCEPT

      6) 如果想让ssh服务开机就运行, 需要使用# ntsysv命令打开开机服务选项卡. 选中sshd后按"OK".

      [root@localhost ~]# ntsysv

      7) 到这里所有工作都完成了, 可以尝试从客户端SSH登陆Fedora. 我用的是PUTTY, 一款非常好用的软件, 支持Telnet, SSH.

  • 相关阅读:
    jq02--基础函数
    jq01--概述
    js06--函数库jq与prototype
    eclipse启动时 failed to create the java virtual machine 解决办法
    将博客搬至CSDN
    eclipse.ini 修改默认编码为 UTF-8
    Elicpse使用技巧-打开选中文件文件夹或者包的当前目录
    eclipse换了高版本的maven插件后报错:org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project
    python进行数据清理之pandas中的drop用法
    如何用Python实现常见机器学习算法-4
  • 原文地址:https://www.cnblogs.com/andy071001/p/3210289.html
Copyright © 2011-2022 走看看