LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   putty shell is different from logging on from console !? (https://www.linuxquestions.org/questions/linux-newbie-8/putty-shell-is-different-from-logging-on-from-console-4175488675/)

kusanagiyang 12-20-2013 08:53 AM

putty shell is different from logging on from console !?
 
Hello friends,

I just became aware of this matter a few moments ago. I usually manage this Linux box of mine with ssh in putty. For no reason, I happened to logon from console today. To my amazement, the console said "command not found" when I tried to use ssh. Then, I use ssh in putty to connect to this box, and "which ssh" then found it.
I thought the console and ssh in putty are the same thing (shell), but obviously they are not. Do you know how they differ ? Thanks~~

nd7rmn8 12-20-2013 09:02 AM

If you are logging in as the same user, they are the same. Perhaps you are logging in as a different user.

kusanagiyang 12-21-2013 12:18 AM

Quote:

Originally Posted by nd7rmn8 (Post 5084507)
If you are logging in as the same user, they are the same. Perhaps you are logging in as a different user.

I used "root" for both....

TB0ne 12-21-2013 09:30 AM

Quote:

Originally Posted by kusanagiyang (Post 5084911)
I used "root" for both....

First, logging in as root is a VERY BAD IDEA. There is NO REASON to do this, ever, unless you're in single-user mode. Otherwise, using sudo (or even an su - ) is the best way.

That said, you need to look in your /etc/profile...there are definitions for the 'console' vs. xterms that set different variables.

shivaa 12-21-2013 11:30 AM

As far as I understood your question, on one side you're trying to connect to a Linux system thru ssh using putty appliication, while on the other side, you're invoking ssh cmd (from an another Linux system's console) to connect to that Linux box... Right?

If this is the case, then note that both works differently. Possibly, ssh cmd is missing in your path variable when trying it in console. And as you said that you found ssh using which ssh then you should add it's absolute path in your path variable (under /etc/profile or /etc/.bashrc file).

However, provide result of following cmds:
Code:

~$ which ssh
~$ echo $PATH



All times are GMT -5. The time now is 12:58 PM.