Skip to main content

The possible way to add a user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file so that other commands won't try to update it simultaneously. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername
  • chown -R username:group .
  • chmod -R go=u,go-w .
  • chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

To create a new account manually, follow these steps:

  • Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file so that other commands won't try to update it simultaneously. You should make the password field be `*', so that it is impossible to log in.

  • Similarly, edit /etc/group with vigr if you need to create a new group as well.

  • Create the home directory of the user with mkdir.

  • Copy the files from /etc/skel to the new home directory.

  • Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one >site to another, but usually the following commands do the right thing:

    cd /home/newusername chown -R username:group . chmod -R go=u,go-w . chmod go= . 
  • Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

The possible way to add a user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file so that other commands won't try to update it simultaneously. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername
  • chown -R username:group .
  • chmod -R go=u,go-w .
  • chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

The possible way to add a user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

  • Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file so that other commands won't try to update it simultaneously. You should make the password field be `*', so that it is impossible to log in.

  • Similarly, edit /etc/group with vigr if you need to create a new group as well.

  • Create the home directory of the user with mkdir.

  • Copy the files from /etc/skel to the new home directory.

  • Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one >site to another, but usually the following commands do the right thing:

    cd /home/newusername chown -R username:group . chmod -R go=u,go-w . chmod go= . 
  • Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

Change the delimiter used with chown to colon from dot
Source Link
Kusalananda
  • 356.2k
  • 42
  • 737
  • 1.1k

The possible way to add ana user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file, so that other commands won't try to update it at the same timesimultaneously. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr, if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername
  • chown -R username:group .
  • chmod -R go=u,go-w .
  • chmod go= .

chown -R username.group .

chmod -R go=u,go-w .

chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

The possible way to add an user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file, so that other commands won't try to update it at the same time. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr, if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername

chown -R username.group .

chmod -R go=u,go-w .

chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

The possible way to add a user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file so that other commands won't try to update it simultaneously. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername
  • chown -R username:group .
  • chmod -R go=u,go-w .
  • chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.

Source Link
Ramesh
  • 40.6k
  • 45
  • 149
  • 222

The possible way to add an user is more or less similar to what I had put in the question. I got this approach from here.

To create a new account manually, follow these steps:

Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file, so that other commands won't try to update it at the same time. You should make the password field be `*', so that it is impossible to log in.

Similarly, edit /etc/group with vigr, if you need to create a new group as well.

Create the home directory of the user with mkdir.

Copy the files from /etc/skel to the new home directory.

Fix ownerships and permissions with chown and chmod. The -R option is most useful. The correct permissions vary a little from one site to another, but usually the following commands do the right thing:

  • cd /home/newusername

chown -R username.group .

chmod -R go=u,go-w .

chmod go= .

Set the password with passwd.

After you set the password in the last step, the account will work. You shouldn't set it until everything else has been done, otherwise the user may inadvertently log in while you're still copying the files.