Skip to main content

Users and Groups in Linux - 3

How to create user without group ?
Up to i searched and tried, we can't create user without group. We can only create a user with already created group.


How to create user with already created group ?
We can create a user with already created group with "-g" or "-G" option with "useradd" command.
Ex.
   useradd -g group1 user1
     //user1 will be create in group1 and group1 will be primary user of user1
   useradd -G group1 user1
     //user1 will be create in group1 and group1 will be secondary user of user1


How to create user without password ?
We can create a user without password by "passwd" command with "-d" option.
Ex.
   useradd test
   passwsd -d test


How to create user with more groups ?
When we create user, the primary group will be creat at same time or we want to mention group name with "-g" or "-G" option. We can mention multiple groups while create new user. And also we cam mention with "usermod" command for existing user.
Ex.
   useradd -g group1 -G group2,group3 test
     //"group1" is primary group for user "test" ; "group2" and "group3" are secondary groups for user "test".
   usermod -g group1 -G group2,group3 test
     //"group1" is primary group for user "test" ; "group2" and "group3" are secondary groups for user "test".


Is possible to change primary group of user ?
Yes we can change primary group of the user with usermod command.
Ex.
   usermod -g group1 user2


How to remove user from the group ?
We can remove user from the group with "gpasswd" command with "-d" option
Ex.
   gpasswd -d user1 group2
   ** If a user have the group as primary group, we can't remove the user from the group.


How to delete a user ?
We can delete user with "userdel" command, At the time of user creation, if we not mention home directory, it'll create a directory with user-name. We can use "-f" option for delete home directory of the user.
Ex.
   userdel -f user1
     //will delete user as well as user directory.


How to delete a group ?
We can delete a group, if it is not primary group of any user. We can use "groupdel" command for delete a group.
Ex.
   groupdel group1


How to make a user as root privileged ?
It's not recommenced for ever. But we can use sudo for make a user as like root (super user).


Is it possible to edit passwd / group file manually ? And it take affects in user and group ?
We can edit passwd , group files in /etc/. And it'll make changes in user, group and their permissions too.


Is it possible to create a user without user directory and how ?

Yeah we can create user without user(home) directory. The command "useradd" with "-M" will do it. We can login with it in terminal , it'll be as bash. and we can login with it as GUI. In gnome we can do only maintenance work it we know password of administrator/root. And be access some applications.

* Use man pages for more help.

Comments

Popular posts from this blog

Install and Uninstall VMware .bundle in Redhat - RHEL 6

Here the steps for Install and Uninstall VMware .bundle in Redhat and also Linux. I have checked with RHEL 6.

For install :
Login in as root user, Type following command

~]# sh VMware-***.bundle

Here *** will be your software and it's version.

This command will display normal GUI installation. Choose option as your wish.

For Uninstall :
Login in as root user, Type following command


~]# vmware-installer -l

This will display your product name and product version installed by VMware.

Ex:
*
*
*
Product Name         Product Version    
========== ==============
vmware-player        4.0.1.528992   

Note Name and Version, Use following command to uninstall

~]# vmware-installer -u {product-name} {product-version}

Ex:
~]# vmware-installer -u vmware-workstation 8.0.1.528992

Now you can uninstall with GUI.

* This is common for all VMware .bundle installation files. Ex: VMware-Workstation, VMware-Player etc.

Play NFS (Need For Speed) or other Games on Full Screen in Laptop with Windows 7

Now a days most of people playing NFS serious (NFS Most Wanted , NFS Carbon etc.) in Laptop.

We are facing the problem that NFS game does not play in full screen mode. It have some black bar at both right and left side.

We can fix it with simple steps, For this your video driver should be installed with it's "Graphics & Media Control Panel" application.

Here i have explained it with screen shot. It'll be mostly same for Intel boards. Settings for other video drivers may differ. You may need to search for it in their graphics control panel.


Step 1 :

Click aero button at right bottom corner for show available notifications and running process. There is Graphics & Media Control Panel Icon.
If it is not avaliable there, you can get it from "Windows Control Panel". It'll open your "Graphics & Media Control Panel".


Step 2 :

Click Graphics & Media Control Panel icon and choose Graphics Properties...


Step 3:

Under Intel Graphics and …