The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Root admin info deedaz UNIX for Dummies Questions & Answers 2 01-20-2008 07:38 AM
Need HPUX admin commands lost sunanda HP-UX 2 05-09-2007 08:42 PM
Name 10 commands every Linux and Unix admin should know Arkitech UNIX for Dummies Questions & Answers 12 11-10-2006 09:21 AM
Canīt issue commands as root kik_xxx SUN Solaris 1 05-03-2005 10:42 PM
root/admin authorization and PackageMaker ropers OS X (Apple) 4 03-04-2004 12:39 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-22-2005
naina naina is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 6
root/admin commands in LINUX

Hi

I am working on LINUX shell scripting. I have root privileges and I know some basic root/admin commands like user creation, modification and so on. Till last week i was able to create users but now i am not able to create users or groups. When I give the command i got an error as
bash: useradd: command not found.

when i searched in bin, I could not see any of the files like useradd or usermod or groupadd

I think someone accidentally deleted these files. If so, is there any way that i can get them back........


Thanks in Advance
naina
  #2 (permalink)  
Old 12-22-2005
ashterix ashterix is offline
Registered User
  
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
maybe your PATH is missing, look into /sbin or /usr/sbin
  #3 (permalink)  
Old 12-22-2005
naina naina is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 6
Thank you

I found these commands in /usr/sbin, but how should I add them to the PATH?
  #4 (permalink)  
Old 12-22-2005
ashterix ashterix is offline
Registered User
  
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
try echo PATH first:
# echo $PATH
then just export it:
# export PATH=$PATH:/usr/sbin

u should put it in your .profile or .bash_profile
  #5 (permalink)  
Old 12-22-2005
naina naina is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 6
Thank you

after exporting they are working fine.........

now should I add it in /etc/profile file

as there are no .profile or .bash_profile for root and i found these files user's home directory
  #6 (permalink)  
Old 12-22-2005
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
NO.
Naina, adding it to /etc/profile is like giving access to all users to these commands inherently. Well its not that users cant add it themselves. But why would you want a regular user to run a useradd command ( he wouldnt be able to run it anyway unless he has root priveleges). But not only useradd, there are other commands in sbin dir which if possible should be hidden from a normal user. As I said earlier a normal user can always add the sbin to his directory, but if he wants to, let him do it, I suggest you should not do that for him. By adding it in /etc/profile you are doing that for him.
Well that is my way of looking at it. I agree there is nothing that can stop this to be more secure, but when you know that the burglars can break the door and come in your house, you still latch the door in the night, right ?
Closed Thread

Bookmarks

Tags
linux, linux commands

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0