Ubuntu 增加和删除用户
添加用户:
- ubuntu@ubuntu:/home$ sudo adduser username
出现如下的信息:
- Adding user username' ...
- Adding new group username' (1001) ...
- Adding new user username' (1001) with group `dengyanhui' ...
- Creating home directory `/home/username' ...
- Copying files from `/etc/skel' ...
- Enter new UNIX password:
- Retype new UNIX password:
- passwd: password updated successfully
- Changing the user information for username
- Enter the new value, or press ENTER for the default
- Full Name []: dahui
- Room Number []:
- Work Phone []:
- Home Phone []:
- Other []:
- Is the information correct? [Y/n] y
输入如下命令:
- ubuntu@ubuntu:~$ ls /home
显示如下:
引用
username ubuntu
说明username用户添加成功
删除用户:
- ubuntu@ubuntu:/home$ sudo userdel username
- 1、首先在Ubuntu安装好samba,具体步骤为:
- 安装samba:sudo apt-get install samba
- 安装smbclient:sudo apt-get install
- 安装smbfs:sudo apt-get smbfs
-
- 2、修改配置文件sudo gedit /etc/samba/smb.conf
- 编辑smb.conf 文件将;security user修改为 security user,
- 然后在配置文件末尾添加
- [ShareFiles]comment = Shared Folder require passwordpath = /home/xiaozhao/share
- public = yes
- writable = yes
- valid users = xiaozhao
- create mask = 0777
- directory mask = 0777
- force user = nobody
- force group = nogroup
- available = yes
- browseable = yes
- 保存后重新启动samba,
- sudo /etc/init.d/samba restart
-
- 3、设置用户和密码sudo smbpasswd -a xiaozhao
- 接着俺提示输入密码。
- 4、最后windows下网上邻居->右键->映射网络驱动器输入
- 文件夹框 \\ip地址\ShareFiles,按提示输入用户名密码即可。