Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have an Windows 2008 Server Instance running on EC2. I have installed an application and added it to the path and it is now available to my Administrator user from the Command Line.

However, when I SSH in to the server as the Admin User, the command is no longer available. If I $echo %path% I cannot see the path to the application I have added.

So it seems that when the same user connects via SSH, a different path is used. But where is this path? Is there a windows equivillant of bashrc that is being loaded instead of the path?

I'm using FreeSSH for the SSH server.

share|improve this question
    
What SSH server are you using? Sounds like a problem with the SSH server. –  Zoredache Jan 10 '13 at 17:30
    
@Zoredache I'm using FreeSSHd. If I check the path I can see the app is referenced, so there must be somewhere else that a path can be loaded from for the user when they access via SSH. –  1ndivisible Jan 10 '13 at 17:35
    
Did you add it to the System path or the User path? Your SSH server might not be loading the one you expect. I've only used CopSSH in a Windows environment so I can't speak for FreeSSHd. –  silmaril8n Jan 10 '13 at 17:45

1 Answer 1

up vote 2 down vote accepted

In Windows, %PATH% is generally loaded when an application or service starts, so you'll need to restart your SSH Server after making the change.

Windows also has two path variables, one global, and one per user, so you have to be careful to modify the right one, to get it working as expected.

To further complicate matters, the method of setting the path environmental variable that I see rise to the top with Google (set) is wrong - "Changes made with SET will remain only for the duration of the current CMD session."

The method I've always used, and yet to have problems with, is the setx command. Follow that with a restart of your SSH server service and you should be good to go.

share|improve this answer
    
Thanks. That makes sense. –  1ndivisible Jan 10 '13 at 18:10
    
@1ndivisible To your bit about OSX, changing global variables in Windows requires a logout (or reboot) for any user's session to pickup the change - so if you're using SSH to allow OSX users to connect to persistent login, they'll have to relog to see the changes (or reboot the server, to do that for them.) –  HopelessN00b Jan 10 '13 at 18:14
    
How would I use setx tin this situation? I just want to add a path to the path, not a key/value variable? –  1ndivisible Jan 10 '13 at 18:19
    
    
Perfection! Thank you very much for your help. –  1ndivisible Jan 10 '13 at 18:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.