Elevated command prompt over SSH


  1. Posts : 2,489
    Windows 7 Ultimate x64
       #1

    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 Computer


  2. Posts : 881
    Windows 7 Ultimate x64
       #2

    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 Computer


  3. Posts : 2,489
    Windows 7 Ultimate x64
    Thread Starter
       #3

    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 Computer


  4. Posts : 881
    Windows 7 Ultimate x64
       #4

    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 Computer


  5. Posts : 2,489
    Windows 7 Ultimate x64
    Thread Starter
       #5

    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 Computer


  6. Posts : 881
    Windows 7 Ultimate x64
       #6

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 04:48.
Find Us