Ubuntu应用或服务安装、配置和使用

star2017 1年前 ⋅ 318 阅读

Ubuntu 应用安装、设置、使用。包括 SSH、DNS、NetWork 等。

安装SSH服务

Ubuntu 18 桌面版默认没有安装 SSH 服务;外部使用 SecureCRT 连接会报错:The remote system refused the connection.

  1. 查看SSH服务

     ps -e|grep ssh
     没有 ssd 表示服务没有安装
    
  2. 安装服务 ssh 服务

     sudo apt install oppenssh-server
    
  3. 再次查看

     ps -e|grep ssh  
     // 显示 ssd 示表安装成功,服务启动;外部使用 SecureCRT 连接。
    

设置DNS

Ubuntu 18.x 出现通过域名访问外网不通,ping ip 可通,在/etc/resolv.conf添加 dns,重络重启或主机重启后,添加的内容会被覆盖,因为resolv.conf文件是动态生成的。解决如下:

vim /etc/network/interfaces
在文件底部添加 dns,如下:
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 10.0.3.4
netmask 255.0.0.0
gateway 10.0.0.1
dns-nameservers 114.114.114.114 202.96.134.133

重启网络服务

重启网络报错:Failed to restart network.service: Unit network.service not found.
Ubuntu 18.x 的网络服务名称是:network-manager,不是 network。

Ubuntu 18.x:service network restart
之前版本的网络服务:service network restart

更多内容请访问:IT源点

相关文章推荐

全部评论: 0

    我有话说: