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.
[root@venkat]#userad -d /opt/123 <user name>
This is one way to change the default user home dir
Change in /etc/default/useradd file
[root@venkat]# vi /etc/default/useradd
Restrict the user in his home dir:
Specify the user in /etc/security/chroot.conf
# username_regex chroot_dir
Save & Exit, thats all now.