建立用户:
useradd -g oinstall -G dba -d /u01/oracle oracle
结果报错:
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
进入/u01/oracle目录,没有.bash_profile',.bashrc,bash_logout
原因:
系统添加用户的标准步骤
1.编辑/etc/passwd与/etc/group
2.创建用户主目录
3.从/etc/skel拷贝文件与目录
4.让新用户获得其主目录与文件的拥有权限
5.给新用户一个密码
<!--[if !ppt]--><!--[endif]-->
解决办法:
依旧使用上面的脚本建用户,然后手动拷贝配置文件到/u01/oracle下。
cp /etc/skel/.bash_profile /u01/oracle
cp /etc/skel/.bashrc /u01/oracle
cp /etc/skel/.bash_logout /u01/oracle
这样既可。
在linux中添加ftp用户,并设置相应的权限,操作步骤如下:
1、环境:ftp为vsftp。被限制用户名为test。被限制路径为/home/test
2、建用户:在root用户下:
useradd -d /home/test test //增加用户test,并制定test用户的主目录为/home/test
passwd test //为test设置密码
3、更改用户相应的权限设置:
usermod -s /sbin/nologin test //限定用户test不能telnet,只能ftp
usermod -s /sbin/bash test //用户test恢复正常
usermod -d /test test //更改用户test的主目录为/test
6、chmod 777 /var/ftp/pub 将相应文件夹权限 打开 即可操作
转载:http://www.cnblogs.com/bienfantaisie/archive/2011/12/04/2275203.html