linux上创建用户后,登陆不行

powang 2007-08-07 10:02:38
使用root登陆系统,使用命令创建用户.
#useradd test
#passwd test
Changing password for user test.
New UNIX password:
Retype new UNIX password:


然后退出,使用新的用户test登陆,输入密码之后,登陆不了.
不知道是什么原因??
...全文
1260 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzcpig 2007-08-07
  • 打赏
  • 举报
回复
我一直在用ssh,没有楼主说得那么麻烦,我是直接在iptable里面把SSH防火墙关了,在我的sshd_config里面也没找到Allowuser字段.....楼主可以试试删掉Allowuser字段。
dai_weitao 2007-08-07
  • 打赏
  • 举报
回复
ssh的问题, 应该是如楼主说的那样, 在allowuser后面添加各个用户帐户.
hefuhua 2007-08-07
  • 打赏
  • 举报
回复
rm -rf /home/test

再重新
#useradd test
#passwd test
Changing password for user test.
New UNIX password:
Retype new UNIX password:
powang 2007-08-07
  • 打赏
  • 举报
回复
重起ssh services sshd restart

====================
改为 重起ssh service sshd restart
powang 2007-08-07
  • 打赏
  • 举报
回复
稍后结帖.
我还有疑问,如果有很多帐户.是否还是在AllowUsers 后面逐个添加各个用户帐户.
这样的工作量不是很大吗?
powang 2007-08-07
  • 打赏
  • 举报
回复
问题已解决,是我描述的不够准确.
我是使用ssh登陆系统的.以root帐号创建用户,创建成功后使用su可以切换.
退出.
使用新的帐号登陆.输入密码,出现错误是 access denied

最终我的解决结果是:
vi /etc/ssh/sshd_config
找到
AllowUsers root
改为
AllowUsers root test
保存退出.
重起ssh services sshd restart

在使用test帐号就可以登陆了^_^
hzcpig 2007-08-07
  • 打赏
  • 举报
回复
提示密码错误还是什么?

用root登录,在终端下su test看看。
powang 2007-08-07
  • 打赏
  • 举报
回复
但是我的的确是有。我贴出来。你们不会攻击我吧,呵呵

# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding no
#X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#ShowPatchLevel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem sftp /usr/libexec/openssh/sftp-server
ReverseMappingCheck yes
GatewayPorts no
AllowTcpForwarding yes
KeepAlive yes
Protocol 2
AllowUsers root test #####在这儿
LoginGraceTime 60
UsePrivilegeSeparation yes
MaxStartups 3
tabno 2007-08-07
  • 打赏
  • 举报
回复
vi /etc/ssh/sshd_config
找到
AllowUsers root
改为
AllowUsers root test
保存退出.
重起ssh services sshd restart

在使用test帐号就可以登陆了^_^
---------------------------------
为什么我在这个sshd_config 里面根本看不见AllowUsers这行啊?
顺德达人 2007-08-07
  • 打赏
  • 举报
回复
把 allowuser去掉就得了
hzcpig 2007-08-07
  • 打赏
  • 举报
回复
上班时间,不能开QQ,MSN等一切即时通讯软件...
powang 2007-08-07
  • 打赏
  • 举报
回复
恩,我到是要试试.hzcpig 可否留下你的MSN
hzcpig 2007-08-07
  • 打赏
  • 举报
回复
……
#Authentication:
#缺省是no
PermitRootLogin yes
#缺省的是no
#PermitEmptyPasswords no
……
hzcpig 2007-08-07
  • 打赏
  • 举报
回复
恩....所以装个VMware是很有必要的...大胆尝试...
powang 2007-08-07
  • 打赏
  • 举报
回复
to hzcpig:
我怕删掉 Allowuser字段 ,到是我连 root用户都进不了了.
我还要跑到机房去设置,不太好啊.

我个人感觉,在 sshd_config 个里面应该有个字段可以设置成全部可以登陆的.

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧