ubuntu 12.04创建多用户及开启telnet远程登录


ubuntu 12.04创建多用户及开启telnet远程登录
 
ubuntu 创建/删除用户及修改密码  
以root帐户登录,
 
创建新用户:
 
运行:$ sudo adduser tete
 
正在添加用户"tete"...
 
正在添加新组"tete" (1002)...
 
正在添加新用户"tete" (1002) 到组"tete"...
 
创建主目录"/home/tete"...
 
正在从"/etc/skel"复制文件...
 
输入新的 UNIX 口令:
 
重新输入新的 UNIX 口令:
 
passwd:已成功更新密码
 
Changing the user information for tete
 
Enter the new value, or press ENTER for the default
 
        Full Name []:
 
        Room Number []:
 
        Work Phone []:
 
        Home Phone []:
 
        Other []:
 
这个信息是否正确? [Y/n] y 
 
输入“y”后按回车就OK了!
 
 
 
删除用户:
 
语法:userdel [-r] [要删除的用户的名称] 
 
例如:[root@localhost ~]userdel -r tete
 
 
 
修改用户密码:
 
该命令的一般格式为: passwd [用户名] 其中用户名为需要修改口令的用户名。只有超级用户可以使用“passwd 用户名”修改其他用户的口令,普通用户只能用不带参数的passwd命令修改自己的口令。
 
该命令的使用方法如下:
 
输入
 
passwd< Enter>;
 
在(current) UNIX passwd:下输入当前的口令
 
在new password:提示下输入新的口令(在屏幕上看不到这个口令):
 
系统提示再次输入这个新口令。
 
输入正确后,这个新口令被加密并放入/etc/shdow文件。选取一个不易被破译的口令是很重要的。
 
选取口令应遵守如下规则: 
 
口令应该至少有六位(最好是八位)字符;
 
口令应该是大小写字母、标点符号和数字混杂的。
 
超级用户修改其他用户(xxq)的口令的过程如下,
 
# passwd root
 
New UNIX password: 
 
Retype new UNIX password: 
 
passwd: all authentication tokens updated successfully
 
#
 
[附:用“su”命令来更换用户,如:$su demo]
 
 
 
开启telnet远程登录
 
 
1.由于ubuntu12.04没有/etc/inetd.conf,故不需要对其进行配置
 
2.安装软件
 
sudo apt-get install xinetd  telnetd
 
3.配置/etc/xinetd.conf和/etc/xinetd.d
 
(1)修改/etc/xinetd.conf如下
 
# Simple configuration file for xinetd## Some defaults, and include /etc/xinetd.d/
defaults{
# Please note that you need a log_type line to be able to use log_on_success
 
# and log_on_failure. The default is the following :# log_type = SYSLOG daemon info
 
instances = 60  
 
log_type = SYSLOG authpriv  
 
log_on_success = HOST PID  
 
log_on_failure = HOST 
 
 cps = 25 30}
includedir /etc/xinetd.d
 
#红色部分具体不知到什么参数
 
 (2)目录/etc/xinetd.d下面就是要启动的服务
 
新建telnet内容:
 
touch telnet
 
编辑内容如下:
service telnet
 
{disable = no
 
flags = REUSE
 
socket_type = stream
 
wait = no
 
user = root
 
server = /usr/sbin/in.telnetd
 
log_on_failure += USERID} 
 
运行sudo /etc/init.d/xinetd restart
 
telnet localhost 可以发现telnet服务已启动。

相关内容

    暂无相关文章