tag:blogger.com,1999:blog-66100902595488566892023-06-20T07:02:52.934-07:00Basic Unix For DBABasic Unix Concepts For DBAUnknownnoreply@blogger.comBlogger13125tag:blogger.com,1999:blog-6610090259548856689.post-25823986670286336422013-06-30T11:45:00.000-07:002013-06-30T11:46:08.172-07:00How to change to root user directly from normal users ?<div class=Section1> <p class=MsoNormal>“su – root” or type “exit” <o:p></o:p></p> <p class=MsoNormal>This command will change from current user to root user or we can type “exit” in the terminal to directly go to the root user from a normal user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-37765231991977133452013-06-30T11:42:00.001-07:002013-06-30T11:42:54.187-07:00How to change from one user to another ?<div class=Section1> <p class=MsoNormal>“su – username”<o:p></o:p></p> <p class=MsoNormal>This command will change the current user to the given user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-54419612245854380482013-06-30T11:40:00.001-07:002013-06-30T11:40:41.549-07:00How to see the uid, gid, group of a user ?<div class=Section1> <p class=MsoNormal>“id username”<o:p></o:p></p> <p class=MsoNormal>This command will show the id, gid, group of a particular user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-2298748242556493312013-06-30T11:38:00.000-07:002013-06-30T11:39:17.765-07:00How to see the details of a particular user ?<div class=Section1> <p class=MsoNormal>“cat /etc/passwd |grep username”<o:p></o:p></p> <p class=MsoNormal>This command will show the details of a particular user.<o:p></o:p></p> <p class=MsoNormal><o:p> </o:p></p> <p class=MsoNormal>grep : global regular expression.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-40029470304057733812013-06-30T11:37:00.001-07:002013-06-30T11:37:26.968-07:00How to see the list of users ?<div class=Section1> <p class=MsoNormal>“cat /etc/passwd”<o:p></o:p></p> <p class=MsoNormal>This command will show the list of all users.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-68240258907621823742013-06-30T11:34:00.000-07:002013-06-30T11:35:31.091-07:00Setting password for new user<div class=Section1> <p class=MsoNormal>“passwd username”<o:p></o:p></p> <p class=MsoNormal>This command will set the password for a given newly created user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-64137353716873376152013-06-30T11:33:00.001-07:002013-06-30T11:33:38.864-07:00Creating a new user<div class=Section1> <p class=MsoNormal>“useradd username”<o:p></o:p></p> <p class=MsoNormal>This command will create a new user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-49816760521981194242013-06-30T11:30:00.001-07:002013-06-30T11:30:35.302-07:00Adding an existing user to a group<div class=Section1> <p class=MsoNormal>“usermod –g existinggroupname existingusername”<o:p></o:p></p> <p class=MsoNormal>This command will assign an existing user to an existing group.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-67477188024533270682013-06-30T11:28:00.000-07:002013-06-30T11:29:04.546-07:00How to Delete an existing group ?<div class=Section1> <p class=MsoNormal>“groupdel existinggroupname”<o:p></o:p></p> <p class=MsoNormal>This command will delete the existing group.<o:p></o:p></p> <p class=MsoNormal>Note : we cannot delete a group if there are users associated with that group.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-1525988002282304442013-06-30T11:26:00.001-07:002013-06-30T11:26:52.497-07:00How to Delete an User ?<div class=Section1> <p class=MsoNormal>“userdel existingusername”<o:p></o:p></p> <p class=MsoNormal>This command will delete the existing user.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-55459209260551521912013-06-30T11:25:00.001-07:002013-06-30T11:25:25.780-07:00Creating n addigning an User to an existing Group<div class=Section1> <p class=MsoNormal>“useradd –g existinggroupname newusername” <o:p></o:p></p> <p class=MsoNormal>This command will create a new user and assignes that user to an existing Group at the time of User creation.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-79930300199120753462013-06-30T11:21:00.001-07:002013-06-30T11:21:58.694-07:00How to list the existing groups ?<div class=Section1> <p class=MsoNormal>“cat /etc/group” command lists all the existing groups.<o:p></o:p></p> </div> Unknownnoreply@blogger.comtag:blogger.com,1999:blog-6610090259548856689.post-60880260809837956542013-06-30T11:18:00.000-07:002013-06-30T11:19:17.910-07:00Creating a Group<div class=Section1> <p class=MsoNormal>“groupadd groupname”<o:p></o:p></p> <p class=MsoNormal>groupadd command is used to create a new group followed by a group name.<o:p></o:p></p> </div> Unknownnoreply@blogger.com