6

Is it possible to create an elevated powershell prompt with MobaXterm? That is, a shell with admin privileges?

Below is a picture of the 'Session' window of MobaXterm with the 'Shell' tab selected, 1. The choice is between Bash, Cmd, Powershell or Ubuntu Bash. However, they open with the permissions of the current user. I'd like to open them (preferably Powershell) as Administrator.

I'm currently using MobaXterm for my ssh needs, and Cmder for local shells. I'd like to harmonize this into a single tool. Cmder has the option to start a new shell as Administrator, but I can not find this option in MobaXterm.

Running Chocolatey is the main thing I'm using an elevated shell for, so it is not that annoying to start some other shell for just that once in a while.

mobaxterm shell window

2
  • Are you asking if you launch a PowerShell command prompt from a MobaXterm terminal or within the terminal have a PowerShell command prompt instance?
    – Ramhound
    Commented Mar 28, 2019 at 14:29
  • @Ramhound, I've clarified te question to show how I start PowerShell from MobaXterm. I'm not sure to which of your two options this correspond though. My problem is getting this shell elevated so I can enter administrator commands.
    – BlackShift
    Commented Mar 28, 2019 at 16:29

2 Answers 2

7

This may not be an elegant solution, but this is what worked for me:

  • Create a shortcut to MobaXterm: On your desktop (or in some other location, i.e. Documents), right-click > New > Shortcut
  • Browse to the location where MobaXterm is installed, select MobaXterm.exe, then click OK (i.e. C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe)
  • Click Next
  • Give your shortcut a name, such as MobaXterm (Admin), then click Finish
  • Right-click the shortcut, then click Properties
  • On the Shortcut tab, click the Advanced... button
  • Select Run as administrator, click OK, then OK again

You'll now be able to run MobaXterm, along with all your sessions with elevated privileges.

NOTE: If you want to keep things tidy, you can also move the shortcut to the folder/directory where MobaXterm.exe is installed. If your MobaXterm folder is in one of the Program Files folders, you won't be able to create the shortcut directly in that location; however, once your create the shortcut following the above steps, you should be allowed to move the shortcut.

Now if you like, for quick access, you can:

  • Pin the shortcut to the taskbar: Right-click the shortcut, then click Pin to taskbar
  • If you use a dock (i.e. ObjectDock), you can drag the shortcut to your dock
  • Add a shortcut on your Desktop (if you chose to create the shortcut in another location)

Since MobaXterm will now have elevated privileges, you may want to secure it by setting up a Master Password (For MobaXterm Professional only):

  • Launch MobaXterm Professional
  • Click Settings > Configuration
  • In the General tab, click MobaXterm passwords management
  • Click the Set a "Master Password" for strong passwords encryption button
  • Enter a password
  • Select Prompt for master password after resuming from monitor standby mode to beef up security even more
    • Click OK, OK, then OK again
3
  • I just noticed that when using the above approach, SFTP/SCP doesn't work correctly. You can download files using the SSH-browser pane; however, you won't be able to upload files back to the server. This could be a bug in MobaXterm, but I'm not 100% certain. If you need SFTP/SCP, then you'll need to use a non-elevated session.
    – kuya1284
    Commented Mar 29, 2019 at 18:18
  • Thanks, this might indeed work. I'm not really comfortable with running all of MobaXterm as Administrator though. (Even though I can't directly think of an actual attack vector.)
    – BlackShift
    Commented Apr 8, 2019 at 8:25
  • I can't click the "run as admin" checkbox, it's greyed :/
    – Olivier
    Commented Nov 13, 2022 at 10:56
1

In case you don't mind that Powershell isn't running in the MobaXterm window you can create a new Session (Shell), choose Powershell and add the following term in Advanced Shell settings:

Start-Process powershell -Verb runAs

Session - screenshot

This is going to open a standalone Powershell session.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .