(1)启动网卡
执行命令:
cd /etc/sysconfig/network-scripts/
然后ls一下,会发现ifcfg-ens32的一个文件。
vi ifcfg-ens32然后将onboot=no改成onboot=yes,保存后退出。
执行命令: ifup ifcfg-ens32
二.安装常用工具
1.安装常用工具
yum install -y openssh-server vim lrzsz wget gcc-c++ pcre pcre-devel zlib zlib-devel ruby openssl openssl-devel patch bash-completion zlib.i686 libstdc++.i686 lsof unzip zip
2.service安装
yum install initscripts
3.ifconfig安装
yum install net-tools.x86_64
4.ssh安装(10.0.75.1为docker的ip)
yum install openssh-server
yum -y install openssh-clients
5.安装完成后,启动sshd:
/usr/sbin/sshd -D
报错则:
ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ''
ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
ssh-keygen -t dsa -f /etc/ssh/ssh_host_ed25519_key -N ''
6.再次启动服务
service sshd restart
#查看是否启动22端口
netstat -antp | grep sshd
三.开启docker-centos76 ssh远程连接服务器
1.修改sshd_config 为密码登录
vim /etc/ssh/sshd_config
#打开注释 PermitRootLogin yes, 允许密码登录,保存退出
2.设置root用户密码
passwd root