Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Elevated command prompt over SSH

27 Jan 2013   #1

Windows 7 Ultimate x64
 
 
Elevated command prompt over SSH

Not sure if this is the proper forum for my question, but here it goes.

I'm using a SSH server to remotely access my notebook from work. It works well for SFTP and remote command line access using a dedicated, non-admin, user account.

Problem is when I want to run something that requires admin permission under that connection. The server runs cmd.exe under the context of a non-admin user I've created for it, so I'm limited in what I can do. Question is, how can I "elevate" that remote command prompt to execute admin-only programs and commands? UAC of course will not help under that conditions.

Thanks!

My System SpecsSystem Spec
28 Jan 2013   #2

Windows 7 Ultimate x64
 
 

before you enter the command you can use the runas command first. You can also save the credentials so you dont have to enter them in every time.

Runas

Example:
Code:
runas /noprofile /user: username "command"
My System SpecsSystem Spec
28 Jan 2013   #3

Windows 7 Ultimate x64
 
 

Thanks Parman, but it doesn't works.
Problem with runas is that it spawns a new console and run the program there, so it's completely invisible and can't interact with it to enter further commands or view output. It simply seems to do nothing, with an unelevated command prompt appearing right after the runas instead of the other program.
My System SpecsSystem Spec
.


28 Jan 2013   #4

Windows 7 Ultimate x64
 
 

You're correct you would have to use runas with every command you want to enter. Why not just log on with the SSH with an account that has admin rights?

What are you using as an SSH server, and client.

What command are you trying to run that you cannot?
My System SpecsSystem Spec
28 Jan 2013   #5

Windows 7 Ultimate x64
 
 

I've tried a few commands, like copying files to system protected locations, starting/stoping a service, launching a new cmd as admin, or even a simple "dir" on an admin-only folders. All without success.
Watching with task manager, I can see that the process effectively starts, but on the SSH client I see nothing, the prompt returns immediately without displaying anything, so I can't see the results. For example, I tried to stop a service, the runas apparently did well, but the service continued to run, but why? No idea without the results on screen. So runas is no good because of its design flaws. There must be another way.

I may be able to just grant connect permission to the admin directly, but I prefer to pass though the non-admin because of security, opening an admin account to internet don't sounds like a good idea to me, at least a two step login to destroy my computer is better . I keep it as the last chance, I will enable it if nothing else works.

For the server, I'm using Bitvise SSH Server, and for the client 64bit PuTTY.
Thanks!
My System SpecsSystem Spec
28 Jan 2013   #6

Windows 7 Ultimate x64
 
 

I have not looked into the Bitvise SSH Server and its capabilities but i just use private keys for authentication when i SSH into my home pc. I also dont use the standard ports either. I never have an issue running any command, but I'm also logged in with an admin account.
My System SpecsSystem Spec
Reply

 Elevated command prompt over SSH





Thread Tools



Similar help and support threads for2: Elevated command prompt over SSH
Thread Forum
Elevated Command Prompt Shortcut Tutorials
Elevated Command Prompt Tutorials
Solved On-Screen Keyboard will only run from elevated command prompt General Discussion
Tip for Elevated Command Prompt General Discussion
Running an elevated command prompt (from the Recovery DVD) General Discussion
How to open Elevated Command Prompt? Performance & Maintenance
elevated command prompt fails General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:48 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33