安装SSH服务
#apt-get install openssh-server
编辑SSH端口
#vi /etc/ssh/sshd_config
确认以下三个部分(如果前面有“#”,则去掉;如果后面的判断条件不一致,则按下面的调整。)
Port xxxxx //修改端口为5位数及以上的未使用的端口,
例:Port 22222
PermitRootLogin yes //如果原来是no或者without-password,就改成yes
PermitEmptyPasswords no //如果原来是yes,就改成no
保存后,重启ssh服务
service ssh restart
第一步
vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto em1
iface em1 inet static
address 192.168.0.89
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.96.128.86 202.96.128.166
dns-search nb-guangzhou
第二步
vi /etc/resolv.conf
nameserver xxx.xxx.xxx.xxx
第三步
vi /etc/resolvconf/resolv.conf.d/head
nameserver xxx.xxx.xxx.xxx
第四步
/etc/init.d/networking restart
#apt-get install openssh-server
编辑SSH端口
#vi /etc/ssh/sshd_config
确认以下三个部分(如果前面有“#”,则去掉;如果后面的判断条件不一致,则按下面的调整。)
Port xxxxx //修改端口为5位数及以上的未使用的端口,
例:Port 22222
PermitRootLogin yes //如果原来是no或者without-password,就改成yes
PermitEmptyPasswords no //如果原来是yes,就改成no
保存后,重启ssh服务
service ssh restart
第一步
vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto em1
iface em1 inet static
address 192.168.0.89
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.96.128.86 202.96.128.166
dns-search nb-guangzhou
第二步
vi /etc/resolv.conf
nameserver xxx.xxx.xxx.xxx
第三步
vi /etc/resolvconf/resolv.conf.d/head
nameserver xxx.xxx.xxx.xxx
第四步
/etc/init.d/networking restart