XZ的账户资料:
使用SecureCRT的ssh2协议远程登陆
ip: 192.XXX.X.XXX
port: XXXX
用户名:xiaohua
密码:123456
$ docker run --name xiaohua_docker -p xxxxx:xx -it -v /home/d/xiaohua:/home/xiaohuac522ac0d6194 bash //将真实路径/home/d/xiaohua映射到docker路径/home/xiaohua,在docker路径下进行开发
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d5f1f550ddfe c522ac0d6194 "bash" 19 seconds ago Exited (0) 5 seconds ago xiaohua_docker
$ docker start xiaohua_docker
$ docker exec -it xiaohua_docker /bin/bash
//安装ssh工具
$ apt-get update
$ apt-get install openssh-server
$ /etc/init.d/ssh restart
(1)切换超级用户,密码123456
$ sudo su
(2) 添加用户
$ adduser xiaohua
Adding user `xiaohua' ...
Adding new group `xiaohua' (1007) ...
Adding new user `xiaohua' (1008) with group `wanggang' ...
Creating home directory `/home/xiaohua' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: (123456)
Retype new UNIX password: (123456)
passwd: password updated successfully
Changing the user information for xiaohua
Enter the new value, or press ENTER for the default
Full Name []: xiaohua(输入全名)
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y (输入y确认)
(3)给当前用户创建root权限和密码
#passwd root //赋予当前账户xiaohua的root权限
#123456 //设置密码:123456
(4) 退出超级用户
$ exit