免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 11813 | 回复: 21
打印 上一主题 下一主题

su: No directory! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-03 16:03 |只看该作者 |正序浏览
# useradd -g oinstall -G dba oracle
# passwd  oracle
oracle用户创建成功后

# su - oracle
su: No directory!

这是为什么,网上没搜到

谢谢

论坛徽章:
0
22 [报告]
发表于 2009-06-04 13:57 |只看该作者
原帖由 guoq.lee 于 2009-6-3 17:32 发表


确实可以了,能说下为什么吗?为什么useradd -g oinstall -G dba  oracle就不行呢

另外#前面怎么设置能让它显示[用户@主机名 目录]



useradd 默认没有使用-m参数的话是不会自动建用户目录的  一般useradd + -d -m

论坛徽章:
0
21 [报告]
发表于 2009-06-03 23:46 |只看该作者
原帖由 brucewoo 于 2009-6-3 21:53 发表
#前面怎么设置能让它显示[用户@主机名 目录]
==>
修改PS1环境变量.


相对而言bash比较容易做到,man bash有详细的说明,只要设置PS1就可以了
\a   an ASCII bell character (07)
\d   the date in "Weekday  Month  Date"  format  (e.g.,
     "Tue May 26")
\e   an ASCII escape character (033)
\h   the hostname up to the first `.'
\H   the hostname
\n   newline
\r   carriage return
\s   the name of the shell, the  basename  of  $0  (the
     portion following the final slash)
\t   the current time in 24-hour HH:MM:SS format
\T   the current time in 12-hour HH:MM:SS format
\@   the current time in 12-hour am/pm format
\u   the username of the current user
\v   the version of bash (e.g., 2.00)
\V   the release of bash, version +  patchlevel  (e.g.,
     2.00.0)
\w   the current working directory
\W   the basename of the current working directory
\!   the history number of this command
\#   the command number of this command
\$   if the effective UID is 0, a #, otherwise a $
\nnn the character corresponding to  the  octal  number
\\   a backslash
\[   begin a sequence of non-printing characters, which
     could be used to embed a terminal control sequence
     into the prompt
\]   end a sequence of non-printing characters
比如: \w显示目录,会随目录变化而变化
ksh要显示目录或时间就比较麻烦些,因为没bash这样的替换符号,你只能用pwd或date来设置,所以要利用其他一些技巧

论坛徽章:
0
20 [报告]
发表于 2009-06-03 21:53 |只看该作者
#前面怎么设置能让它显示[用户@主机名 目录]
==>
修改PS1环境变量.

论坛徽章:
0
19 [报告]
发表于 2009-06-03 21:24 |只看该作者
原帖由 guoq.lee 于 2009-6-3 20:58 发表
谢谢大家乐,刚接触solaris,实在查不到才问的。

#前面怎么设置能让它显示[root@lee ~]#,现在没有[root@lee ~]


这个在bash或ksh下都可以实现,man bash or man ksh,注意看一下关于PS1的内容

论坛徽章:
0
18 [报告]
发表于 2009-06-03 20:58 |只看该作者
谢谢大家乐,刚接触solaris,实在查不到才问的。

#前面怎么设置能让它显示[root@lee ~]#,现在没有[root@lee ~]



---
不好意思,想“引用”的,点击了“编辑”
                                     -- Doni

[ 本帖最后由 doni 于 2009-6-3 21:23 编辑 ]

论坛徽章:
0
17 [报告]
发表于 2009-06-03 18:29 |只看该作者
关于/home下无法建目录,自我上CU以来,回答过不少于10次,有兴趣的CUer自己找一找吧

论坛徽章:
0
16 [报告]
发表于 2009-06-03 17:50 |只看该作者

回复 #15 风之幻想 的帖子

-d dir

         Specify the new home directory of the user. It  defaults
         to  base_dir/login, where base_dir is the base directory
         for new login home directories, and  login  is  the  new
         login.
谢谢

论坛徽章:
0
15 [报告]
发表于 2009-06-03 17:45 |只看该作者
原帖由 yqx1986 于 2009-6-3 17:44 发表
手工建主目录,然后如何指定给用户?
我刚才试过在smc的里给用户指定了主目录,但是没成功,还是找不到主目录


用usermod来做。

论坛徽章:
0
14 [报告]
发表于 2009-06-03 17:44 |只看该作者

回复 #11 山野村夫 的帖子

手工建主目录,然后如何指定给用户?
我刚才试过在smc的里给用户指定了主目录,但是没成功,还是找不到主目录
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP