User add already exist
Dear All,
I am trying to chroot a user to just a folder and trying to follow the steps here http://www.thisisnotsupported.com/sf...il-on-centos6/ .The problem I am stuck here useradd -d /usr/local/test1 -s /bin/false -G sftponly user1 it gives me useradd: user 'user1' already exits. The problem I have add user1 before this steps. So how to go about it. |
If it is just a test user which you created then delete the user and recreate changing the default home directory and shell
and if the user is useful then Code:
#usermod -d (path to new dir) -s (path to new shell) username |
usermod may be what your looking for to modify an already existing user,
edit, i was a little slow in posting, deep27ak was quicker lol |
Dear All,
I can delete but for learning purpose I would like to try to am I doing this rite usermod -d /usr/local/test1 -s test1 I do not know what to put for the path of new shell? |
Quote:
You can do like this if you want to give /bin/bash shell. Quote:
Quote:
http://www.cyberciti.biz/faq/tag/useradd-command/ http://www.cyberciti.biz/faq/tag/usermod-command/ |
Quote:
Code:
#usermod -d (path to dir) -s (path to shell) -G (group name) username Code:
#usermod -d /usr/local/test1 -s /bin/false -G sftponly user1 |
Dear All,
Thank you all that works and even the securing works the user can just sftp and see only one folder. Will there be any loophole for this sort of settings where they can access the other files via other routes? |
If you have used chroot for any user then he/she will not be allowed to move out of his/her box.
and I believe you got your answer so Please mark the thread as "solved" |
Dear Deepak,
Where is the solved button? |
Go on the thread where all the post are shown on the top right corner you will see the place where it is written
"Please Mark this thread as solved if you feel a solution has been provided. " just above were it is written "Post Reply" |
Dear Deepak,
Ok what I can see right left top is post reply and below is a row with Thread Tools LinkBack Search this Thread Rate Thread ? So I still dont see the marked as solved? Thank you. |
Quote:
|
Dear Deepak,
Yes I cant see the word solved any where either. Thank you. |
All times are GMT -5. The time now is 11:30 PM. |