群晖docker 安装centos 并在本机ssh登录
第一步:套件中心安装docker,注册表搜索centos,双击下载,选择喜欢的版本,我选的7.9
第二步:双击安装到容器进行配置,高级选项中,自动启动选上。本地端口换成10022,容器端口22,存储空间,在docker下建文件夹centos存放文件,装载路径给\data,应用启动
第三步:进终端机,首先更新系统
yum -y update
安装所需yum包
yum install vim openssl openssh-server net-tools initscripts -y
创建ssh key
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 、修改sshd_config
vim /etc/ssh/sshd_config
UsePrivilegeSeparation sandbox 改为 UsePrivilegeSeparation no
UsePAM yes 改为 UsePAM no
修改Port 22 为Port 2222
找到#PermitRootLogin no 去掉#,把no改成yes
修改后:wq保存
7、启动ssh
/usr/sbin/sshd -D &
echo "/usr/sbin/sshd -D &" >> /etc/rc.local #添加到开机启动,就不用每次重启后运行了
8、修改root密码 passwd root