Quote:
Originally Posted by JJX
Is any way to lock a user in his home directory or to a specific dir [/opt/123/] ?
|
Yes, it is possible to restrict the user in his home dir.
To change the user home dir, pl follow below steps.
1)
[root@venkat]#userad -d /opt/123 <user name>
This is one way to change the default user home dir
2)
Change in /etc/default/useradd file
[root@venkat]# vi /etc/default/useradd
HOME=/opt/123
Restrict the user in his home dir:
Specify the user in /etc/security/chroot.conf
Example:
# /etc/security/chroot.conf
# format:
# username_regex chroot_dir
#matthew /home
venkat /opt/123
Save & Exit, thats all now.