重庆思庄Oracle、Redhat认证学习论坛

标题: 创建oracle用户后,切换用户,没有/home/oracle这个目录 [打印本页]

作者: 曾春华    时间: 2016-3-18 09:56
标题: 创建oracle用户后,切换用户,没有/home/oracle这个目录
安装数据库的时候我们需要用oracle用户,可是今天创建oracle用户,切换过去有一个警告信息。
rac01:~ # su - oracle
su: warning: cannot change directory to /home/oracle: No such file or directory


以前创建没有遇到过这个问题。

原来这是因为我的系统是
SUSE Linux Enterprise Server 11
在SUSE系统下创建用户 时要加 -m 参数才会给新用户创建/home目录

重新创建
useradd -m oracle

rac01:~ # su - oracle
oracle@rac01:~>

oracle@rac01:~> cd /home
oracle@rac01:/home>


不再有警告信息,/home目录已经创建。

作者: 郑全    时间: 2016-3-21 10:51
察看一下,是否有 /etc/login.defs,如果有,把这个文件内容发出来看看
作者: 曾春华    时间: 2016-3-21 15:14
/etc/login.defs 的文件内容如下
# /etc/login.defs - Configuration control definitions for pwdutils package.
#
# Comment lines (lines beginning with "#") and blank lines are ignored.
# Please read the manual page for more information (login.defs.5).
#
#
# Should login be allowed if we can't cd to the home directory?
# Default is yes.
#
DEFAULT_HOME            yes
#
# The default PATH settings (used by login):
#
ENV_PATH                /usr/local/bin:/usr/bin:/bin
#
# The default PATH settings for root (used by login):
#
ENV_ROOTPATH            /sbin:/bin:/usr/sbin:/usr/bin
#
# Delay in seconds before being allowed another attempt
# after a login failure
#
FAIL_DELAY              3
#
# If defined, file which inhibits all the usual chatter
# during the login sequence. If a full pathname, then hushed
# mode will be enabled if the user's name or shell are found
# in the file.  If not a full pathname, then hushed mode will
# be enabled if the file exists in the user's home directory.
#
#HUSHLOGIN_FILE .hushlogin
HUSHLOGIN_FILE  /etc/hushlogins
#
# Enable logging and display of /var/log/lastlog login time info.
#
LASTLOG_ENAB            yes
#
# Enable display of unknown usernames when login failures
# are recorded.
#
LOG_UNKFAIL_ENAB        no
#
# Max number of login retries if password is bad
# This variable is deprecated and will be removed with the next version.
#
LOGIN_RETRIES           3

和redhat的有区别,没有CREATE_HOME这个参数  
将CREATE_HOME yes 这个参数加入到文件中去,再去创建用户 ,依然没有自动创建/home 目录
rac01:~ # su - test
su: warning: cannot change directory to /home/test: No such file or directory






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2