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 10-26-2015, 12:00 AM   #1
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Rep: Reputation: Disabled
when "ssh localhost" all commands not found


I am very new to Linux, please bear with me. I've just installed CentOS7. I am trying to install hadoop. After creating a 'hadoop' user, the instructions I'm following say to run: ssh localhost (just to test it I'm guessing). That's when things go awry, and I am not able to continue with my installation.

My guess is a PATH has gotten mangled somewhere along the way.. perhaps? I did install Java 1.8, and some python libraries prior to this.

Can it be fixed, or reset?

Thanks in advance,
Koza

[hadoop@uk ~]$ ssh localhost
Last login: Sun Oct 25 23:35:44 2015
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: tty: command not found
-bash: ls: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
-bash: tty: command not found
-bash: mktemp: command not found
-bash: $TMP: ambiguous redirect
-bash: rm: command not found
-bash: grep: command not found
bash: perl: command not found...
bash: grep: command not found...
bash: uname: command not found...
 
Old 10-26-2015, 12:05 AM   #2
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Yes, probably you messed up your path...

Could you run
Code:
/usr/bin/cat ~/bash_profile
(or any other user file that you were asked to modify) and paste the result?
 
Old 10-26-2015, 12:11 AM   #3
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
[hadoop@uk ~]$ /usr/bin/cat ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin:/bin:/usr/local/bin

export PATH
 
Old 10-26-2015, 12:16 AM   #4
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
hmm... Can you
Code:
echo $PATH
(sorry I didn't also asked for this the first time -- I just thought it's a typo in your bash_profile)
 
Old 10-26-2015, 12:22 AM   #5
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
[hadoop@uk ~]$ echo $PATH
/home/hadoop/perl5/bin:/usr/lib64/qt-3.3/bin:$PATH:/opt/jdk1.8.0_60/bin:/opt/jdk1.8.0_60/jre/bin:/usr/local/sbin:/usr/sbin:/home/hadoop/.local/bin:/home/hadoop/bin:/bin:/usr/local/bin
 
Old 10-26-2015, 12:24 AM   #6
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Ok... In your ~/.bashrc you probably have a line that starts with PATH= and contains values in simple quotes(')
Edit the file and simply remove those quotes or transform them in double quotes (")

You should be able to start a quick familiar editor with:
Code:
/usr/bin/mcedit ~/.bashrc

Last edited by Smokey_justme; 10-26-2015 at 12:26 AM.
 
Old 10-26-2015, 12:28 AM   #7
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
I don't see that. But I think I see what you are getting at. Is it the $PATH part in the PATH?

Here is my .bashrc. THere isn't much there:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
 
Old 10-26-2015, 12:32 AM   #8
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Yes.. That $PATH got there because bash did not expand it (one common reason being the use of single quotes)..
If it's not there then you mangled with your system setting... Search in /etc/bashrc and try to locate the problem..

P.S. If it's not obvious, you can get a functional temporary session by running
Code:
PATH=/usr/bin:$PATH
.. But you still need to find and correct the actual problem..
 
1 members found this post helpful.
Old 10-26-2015, 12:49 AM   #9
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
it was this, in the /etc/environment file. When I removed it, I no longer got the messages about missing commands when running ssh localhost.

There are no quotes though, single or double. Is this syntax incorrect?

export JAVA_HOME=/opt/jdk1.8.0_60

export JRE_HOME=/opt/jdk1.8.0_60/jre

export PATH=$PATH:/opt/jdk1.8.0_60/bin:/opt/jdk1.8.0_60/jre/bin
 
Old 10-26-2015, 01:01 AM   #10
kyleiwaniec
LQ Newbie
 
Registered: Oct 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you Smokey_justme.

Really appreciate the help

I marked this as solved. This is my first time on this forum, is there anything else I need to do? award points?
 
Old 10-26-2015, 01:12 AM   #11
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
It's weird... That should have been a problem.. But at least it's solved for now... About the forum, it's ok.. Just marking a topic as solved to be easily discovered that it contains a solution is sufficient...
 
Old 10-26-2015, 05:16 AM   #12
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by kyleiwaniec View Post
it was this, in the /etc/environment file. When I removed it, I no longer got the messages about missing commands when running ssh localhost.

There are no quotes though, single or double. Is this syntax incorrect?

export JAVA_HOME=/opt/jdk1.8.0_60

export JRE_HOME=/opt/jdk1.8.0_60/jre

export PATH=$PATH:/opt/jdk1.8.0_60/bin:/opt/jdk1.8.0_60/jre/bin
To expand on this: Quotation marks are only needed if you want to remove the special meaning of special characters, like * (asterisk), ? (question mark), $ (dollar sign) and so on. There are no special characters in the strings above.

You can use single quotation marks, which quote everything except single quotation marks.
Or you can use double quotation marks, which don't quote everything. Notably, strings that start with a $ (dollar sign) will be interpreted as shell variables inside (and of course outside) double quotes.
 
  


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] X: "loading extension glx" "no screens found" "fatal server error" (w/ nvidia driver) Geremia Slackware 7 12-29-2014 12:00 PM
[SOLVED] Don't understand how to use SSH keys with "ssh" and "scp" commands on Lubuntu maples Linux - Newbie 12 03-10-2014 11:09 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
DNS error : "localhost.zone file not found" rajat Linux - Server 2 04-26-2007 12:26 AM
"commands not found" errors when installing on Suse 9.0 sapphirewolf Linux - Software 5 03-25-2004 11:22 PM


All times are GMT -5. The time now is 02:55 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