LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2013, 09:39 AM   #1
goelashish
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Rep: Reputation: Disabled
Question Linux commands & sudo not working


Hello All,

I have installed RHEL 5.0 on virtualbox as guest OS and using Windows 7 as Host OS.

The installation is successfully done but now when I execute any command it says command not available like visudo, apt-get install, etc.

Also, when I use sudo to run a command it asks me for the password but after 3 attempts it says incorrect password. 3 attempts made.

I have checked the sudoers file and it does not have a sudo group and the username which I am using.


Kindly help and advice. I am not able to figure out the problem.
 
Old 11-22-2013, 09:55 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
First of all: Why are you using RHEL? You do know RHEL isn't a free product?

Server based alternatives for RedHat EL (free and 99.9% compatible):
- CentOS
- Scientific Linux

Consumer based alternative for RedHat EL (free, and geared toward home usage):
- Fedora

Second: If you do need to use RHEL, make sure you use a current version (which would be RHEL 6.5 atm).


About your question: sudo isn't configured out-of-the-box (unlike, for example Ubuntu). It just has the basic settings, that's all.

Which password are you using, it should be the users password and not the root password (seems obvious, but I've seen this often)? Even if sudo isn't set up for your specific needs, it should ask you for your password and if the correct password is given you will probably end up with a username is not in the sudoers file. This incident will be reported message.

- Did you edit the sudoers file (using visudo) at all?
- Which exact command did you use?
 
1 members found this post helpful.
Old 11-22-2013, 10:08 AM   #3
goelashish
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Druuna, thanks for your reply.

yes I dont have to use RHEL, I had the installer with me so I used it instead of downloading the CentOS or other free linux. I can switch to a free linux though.

Yes I was using the root password and this is why I was getting incorret password. And now I used the user password and it gave me the message "ashishg is not in the sudoers file. This incident will be reported."

- Did you edit the sudoers file (using visudo) at all? I didn't edit the sudoers file.
- Which exact command did you use? I used visudo that also I could not open without using "su -", earlier I was trying to open with "su" and it did not work. Other commands that I run as a user, it says command not found.

Now plz advice what to do? Should I make a new install with CentOS? and what about the commands that are not working?
 
Old 11-22-2013, 10:19 AM   #4
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 906Reputation: 906Reputation: 906Reputation: 906Reputation: 906Reputation: 906Reputation: 906Reputation: 906
I'd bet you are trying to use ubuntu commands goelashish. Ubuntu is a linux distro, but its quite different to Red Hat and other RPM distros.
 
1 members found this post helpful.
Old 11-22-2013, 10:23 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Ubuntu and its forks are the only distros out there foolish enough to enable sudo by default and to put administrative tasks into the hands of the normal user account. this is bad practice and has been since day 1.

in the rest of the Linux world, if you wish to perform a root level, administrative, task you perform this task as root. su -, then root password, then issue the commands you require as root, then exit to get out of the root shell.

also apt-get is not for the RHEL world, it is for Debian and its forks, that includes ubuntu. in the RHEL, or rpm world, you use yast or yum. for RHEL specific its yum, but as you dont have an active account it will fail to connect as you will not be authorized to run RHEL without paying for the SLA. install CentOS as you appear to be planning on doing, then you will be able to yum update/install/remove packages as you desire.

also do not bother any longer with the rpm command always use yum to avoid dependency hell. even if the web page you got the foo.rpm package from tells you to run rpm -ivh or -Uvh, or what ever argument, just yum install foo.rpm

good luck and enjoy.
 
Old 11-22-2013, 10:29 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by goelashish View Post
Yes I was using the root password and this is why I was getting incorret password.
Using the root password would defeat the purpose of using sudo.

Quote:
And now I used the user password and it gave me the message "ashishg is not in the sudoers file. This incident will be reported."
As I predicted in my previous post.

Quote:
Should I make a new install with CentOS? and what about the commands that are not working?
If I assume you want to learn how RHEL (and alike distro's) work I would advise you to install a current version of CentOS.

If you want to learn Linux in general and you are inexperienced I would advise Mint.

Which commands to use and how to set them up correctly depends on which Distro you are using. As stated in my previous post: Ubuntu, for example, has a working sudo setup out-of-the-box. On systems that do not have this you need to become root user (log in as root or become root using su -). From here you can set up sudo or execute commands that need root privileges.
 
Old 11-22-2013, 10:39 AM   #7
goelashish
LQ Newbie
 
Registered: Nov 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Wow, what a fool I have been using Ubuntu commands in rhel.

Thankfully I had some wisdom left I posted here and you guys came to help. I will switch to Mint or may be CentOS. Actually, I plan to use AIX & Linux in my job and therefore wanted to practice it at home.

Guys, plz some more insight rqd: What should I use as a platform if I have to use AIX & Linux OS while at job?

Thank you all.

Drunna @ Thank you so much!
 
Old 11-22-2013, 11:34 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by goelashish View Post
Guys, plz some more insight rqd: What should I use as a platform if I have to use AIX & Linux OS while at job?
You can only learn AIX by using AIX. It is Unix based, but I would call it the odd-man-out in the Unix world. It is geared towards security out of the box and has some nifty tools you need to use. The basics are still Unix based but if you come from Solaris or HP-UX things will definitely be different.

The most common Linux flavours I encountered on production platforms are: RHEL/CentOS and (open)Suse. I have seen Debian and Ubuntu server as well, but they are much less common. I would focus on RHEL/CentOS.
 
Old 11-22-2013, 03:09 PM   #9
aristocratic
Member
 
Registered: Sep 2011
Location: Texas
Distribution: Open SuSE 12.1, Lucid Puppy
Posts: 90

Rep: Reputation: Disabled
Drunna, is there any advantage to using CentOS over Fedora (or vice versa)?
 
Old 11-22-2013, 03:26 PM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by aristocratic View Post
Drunna, is there any advantage to using CentOS over Fedora (or vice versa)?
Fedora is geared towards home users and is (far?) ahead with regards to newer versions of software.

CentOS (RHEL) is for production environments (which might include user side). The software might be a version (or 2) behind, but they have proven themselves (stability).

At work I work a lot with servers running RHEL and I installed Fedora on my work laptop. They basically work the same, but the user experience on my laptop is better with Fedora installed instead of RHEL (client or server).

The possible advantage depends on your point of view. If, as a beginner, you want to learn a Linux flavour that is used in many production environments and also want a good user experience I would advise you to install Fedora.
 
1 members found this post helpful.
Old 11-22-2013, 07:32 PM   #11
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by aristocratic View Post
Drunna, is there any advantage to using CentOS over Fedora (or vice versa)?
the biggest difference between the Fedora line and RHEL (CentOS) is one is a server designed for long term support (5year min life cycle and can be extended out to 10+yrs) while Fedora is a "desktop" environment designed to change very fast, test new software, run newer kernels, etc...

RHEL 6.x is still running the 2.6.32 kernel and will until it is completely depreciated. Fedora 19 is running the much newer 3.11 or 3.12 kernel and will continue to change every 15-18mo with the release cycle.

RHEL 7.x will be running the much newer 3.11 or 3.12 kernel and will run that kernel for its entire life cycle. RHEL 6 is based on Fedora 12 and 13, while RHEL 7 is based of Fedora 19 and 20.

The biggest advantage of RHEL, and its forks, is long term support for 3rd party applications and services. I would NEVER run Fedora for any kind of server as it changes way to fast, but it is great for a desktop.

Most of the Linux servers I deal with are RHEL based, that includes SuSe as it is also a rpm based distro that has moved so far away from RHEL, except their unbreakable that is built on RH source code with their own flairs tossed in that truly do break the source.

And Debian. Ubuntu LTS is gaining grounds, but to be blunt I'd never run any distro as a server that's default is to act like Microsoft and put the power of the administrator into the hands of the user. bad design and will lead to bad habits as well as drastically increasing the risk of security breaches as well as other human errors to damage and or destroy data.

From a workstation perspective, Fedora is my choice, but raw Debian is great too. Again im not a fan of Ubuntu or their forks for the reason mentioned above, but more importantly with the newest version of Ubuntu i refuse to ever install it again until Canonical, the creators of the fork, remove their built in spyware.
 
1 members found this post helpful.
Old 11-23-2013, 11:02 AM   #12
aristocratic
Member
 
Registered: Sep 2011
Location: Texas
Distribution: Open SuSE 12.1, Lucid Puppy
Posts: 90

Rep: Reputation: Disabled
Drunna and lleb, Thanks for taking the time to respond! I'm having a blast learning Linux. Right now I am using openSuSE. It seems like a good platform to start on, though it took me awhile to troubleshoot the wireless connection so I could get on the internet. I am wanting to learn other flavors, and am thinking of switching to Fedora next. Right now I use Linux alot on my laptop at wifi hotspots. I am wanting to eventually configure a LAN in my apartment and set up a server. It's turning into a serious hobby for me.

It is interesting to get first hands advice from the people who use Linux in industry. Thanks again!
 
Old 11-23-2013, 11:05 PM   #13
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
i have not used OpenSuSe in a long time (since SuSe v9) so before the buyout by Novell. What I do have to say is that some of the GUI networking tools are the best in the business. sadly their GUI is HORRIDLY slow and pathetic. its a wash... Again Ive not used SuSe in a very long time, but loved it when I used it.

To me Linux is the best platform out there for personal user unless you are required to run specific software for work/school. I currently only run win7 for the performance of F@H via GPU and for playing a few games without issue.

Other then that my entire house is OSx and Fedora. Welcome to the FOSS world and Linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] WinSCP, sudo & SFTP: can't get them all working together Glop Linux - Newbie 1 12-12-2012 12:28 PM
[SOLVED] How to know all commands available from Sudo? Xeratul Linux - Newbie 5 11-03-2012 12:25 PM
sudo apt-get update && sudo apt-get upgrade hallve_revera Linux - Newbie 6 01-10-2009 10:37 AM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration