Linux User & File Management

From 2047Servers Support
Jump to: navigation, search
Line 81: Line 81:
  
 
You will have to edit your "proftpd.conf" file (or the vsftpd.conf file if you are using vsftpd instead) within that file you will see an option for default login root folder (If it is hashed out "#" unhash it & set it as "DefaultRoot ~"  
 
You will have to edit your "proftpd.conf" file (or the vsftpd.conf file if you are using vsftpd instead) within that file you will see an option for default login root folder (If it is hashed out "#" unhash it & set it as "DefaultRoot ~"  
 +
 +
Command to add a new user "testftp" & create a home / login folder in "/home/testftp"
 +
 +
<pre>useradd -m -d /home/testftp testftp</pre>
 +
 +
Set the password for the user
 +
 +
<pre>passwd testftp</pre>
 +
 +
====SSH Lockout===
 +
 +
<pre>nano /etc/passwd</pre>
 +
 +
Edit this file, find at the bottom their user name
 +
 +
You will see something like
 +
 +
<pre>testftp:x:1001:1001::/home/testftp:/bin/sh</pre>
 +
 +
name:x:userid:groupid::login/folder:/ssh settings (bin/sh = SSH Access, change this to /bin/false to prevent SSH login for this user)
 +
 +
You can also change the login/folder to where you want (as long as they have permissions to get into that folder it will work)
 +
  
 
Now if you have already created your user great, if not see the steps above on creating a user (useradd username), Once you have created a user edit the "/etc/passwd" file & edit the home directory to the folder location you want e.g. /home/newuser (Make sure that user has permission on that folder, otherwise they wont be able to login (because they dont have access to that folder)
 
Now if you have already created your user great, if not see the steps above on creating a user (useradd username), Once you have created a user edit the "/etc/passwd" file & edit the home directory to the folder location you want e.g. /home/newuser (Make sure that user has permission on that folder, otherwise they wont be able to login (because they dont have access to that folder)

Revision as of 19:22, 27 August 2013

Personal tools
Namespaces

Variants
Actions
Navigation
Categories