Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command Line support #69

Closed
Midnex opened this issue Jun 8, 2021 · 32 comments
Closed

Command Line support #69

Midnex opened this issue Jun 8, 2021 · 32 comments

Comments

@Midnex
Copy link

Midnex commented Jun 8, 2021

Would like to see command line support so I can add RustDesk to env variables, and push an id as an argument along with ability to push a password if needed.

Of course the command line interface would need to support other things as well, but this support would be a nice addition.

This feature could also be used to drop shortcuts on to the users desktop, that calls RustDesk and connects to a saved id in the shortcut file. Similar to how AnyDesk does it.

@rustdesk
Copy link
Owner

rustdesk commented Jun 9, 2021

drop shortcuts

1.1.6

@rustdesk
Copy link
Owner

rustdesk commented Oct 5, 2021

@rustdesk rustdesk reopened this Oct 5, 2021
@Midnex
Copy link
Author

Midnex commented Oct 6, 2021

Glad to see this reopened.

@rustdesk
Copy link
Owner

rustdesk commented Oct 6, 2021

Because someone mentioned this on discord, and I have been investigating on AnyDesk/TeamViewer/Parsec API lately.

@radiobut
Copy link

It would be very nice to be able to start a connection from the command line. For example, to integrate with other remote connection management tools.

@bilogic
Copy link

bilogic commented Jul 29, 2022

Teamviewer https://community.teamviewer.com/English/kb/articles/34447-command-line-parameters

I normally use teamviewer.exe -i <id>, and it prompts for password, very useful if there are many machines to manage.

@rustdesk
Copy link
Owner

--connect <id>

@bilogic
Copy link

bilogic commented Jul 29, 2022

--connect <id>

wow thanks! is it documented anywhere?

@Shahin-rmz
Copy link

Shahin-rmz commented Aug 2, 2022

Hello,
A power user (not a dev) here.
First:
Rustdesk is WAY better than Anydesk or Teamviewer.
I have installed it on my parent's Raspberry pi.
and can control the Raspberry remotely and play Movie for them.
Thanks <3

Now a question:


Can I connect via SSH and generate a password, (or see the password) and then connect via client to the Raustdesk?


Thanks

@bilogic
Copy link

bilogic commented Aug 3, 2022

Can I connect via SSH and generate a password, (or see the password) and then connect via client to the Raustdesk?

Are you suggesting this is more secured than having a static complex password on rustdesk?

Frankly, I think it takes the same flow and effort to steal your static complex password vs your SSH password/key.

@Shahin-rmz
Copy link

Frankly, I think it takes the same flow and effort to steal your static complex password vs your SSH password/key.

You are right.
Ultimately I like to:

  • have a dynamic password for every new connection every time but a static password for trusted connections.
    Or other way around,
  • trusted connections make a pair of password each time.

@bilogic
Copy link

bilogic commented Aug 4, 2022

Haha, we are going in circles: how do you determine if a connection is a trusted one?

Teamviewer does it by having 2 passwords, a dynamic one and static one, either one will allow you to login.

The closest I can think of is to have the dynamic password regenerate after each disconnection, but the static remains and is available to all connections, just make sure to keep it complex.

@Shahin-rmz
Copy link

Haha, we are going in circles: how do you determine if a connection is a trusted one?

You are right. :) I am thinking that if both parties check the trusted box, then we the connections are trusted.

The closest I can think of is to have the dynamic password regenerate after each disconnection, but the static remains and is available to all connections, just make sure to keep it complex.

This is one good approach, the other one is to have static password just for some connections and not global.

@paulbdavis
Copy link

Jumping in this issue to say it would be good to be able to get the current ID and password via the command line.

The use case is having a machine that's out in the field where there is not someone present to read off the ID and password or interact with the UI component (the UI would not even be launched). It would be good to dump these out on the command line when connected to said machine via SSH

like:

$ rustdesk --info

ID: 123 123 123
Password: abcdef

@paspo
Copy link

paspo commented Aug 18, 2022

you can read ID and password from the config files:

  • C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\RustDesk\config\RustDesk.toml (windows)
  • /root/.config/rustdesk/RustDesk.toml (linux)
  • /Library/Preferences/com.carriez.RustDesk/RustDesk.toml (OSX)

(password can be salted)

@rustdesk
Copy link
Owner

will be encrypted in next release

@bilogic
Copy link

bilogic commented Aug 19, 2022

Jumping in this issue to say it would be good to be able to get the current ID and password via the command line.

I think it is generally not safe to expose the ID and password via an "API" approach. Anything else can also call the "API" and gain access. Getting a dynamic password via "API" using SSH is equivalent to setting a static password (SSH being the static in this case).

It is probably best to just let Rust Desk do its best to protect the static password instead of making it leak credentials via an "API".

@paulbdavis
Copy link

For the password, sure, I suppose that makes sense, but getting the ID and being able to set the password would be enough really.

Having it disabled by default would obviously be best as well, but there should be a way to get/set the credentials for a remote machine without anyone actually being present.

@bilogic
Copy link

bilogic commented Aug 23, 2022

Having it disabled by default would obviously be best as well, but there should be a way to get/set the credentials for a remote machine without anyone actually being present.

In that case, I think it is better to state the problem ("How to perform unattended remote installation") instead of suggesting the solution.

In one of the VPS that I use, they ask for my SSH public key when provisioning the server. i.e. unattended installs must have a static password, but please don't quote me on that, authentication/credential modifications must always be rigorously thought out.

@jcelerier
Copy link

In that case, I think it is better to state the problem ("How to perform unattended remote installation") instead of suggesting the solution.

what's the solution to this problem? how can I get a remote desktop remotely from a machine which has nothing installed and to which I have a ssh access ?

@paulbdavis
Copy link

paulbdavis commented Oct 11, 2022 via email

@rustdesk
Copy link
Owner

Yes, enced in next release.

@ssteeltm
Copy link

would be nice if I could connect via CMD with:
rustdesk.exe --connect <ID> --password <password>

@bilogic
Copy link

bilogic commented Oct 14, 2022

--connect <id>, use rustdesk to remember the password

@Onyx47
Copy link
Contributor

Onyx47 commented Oct 22, 2022

Lack of an option to retrieve the ID programmatically, possibly from a file or as a command-line option that can only be read/ran as root/elevated user is what's currently stopping me from replacing AnyDesk with RustDesk for my use case.

Having the ID recorded somewhere where it's only accessible to root/admin does not strike me as a huge security risk (AnyDesk does this as well, as an aside), and enables easier automation for cases where you already have some kind of elevated access available to you and you just need that extra step of being able to access the GUI.

Also, just to point out, when starting RustDesk from terminal on Linux, it still spits out the ID to stdout, so it's technically still possible to grab the ID programatically, but this is not something I'd rely on, plus it's inconsistent - it's encrypted in a file but it's readable by a regular user if they can just execute a command as an unprivileged user.

@mikelwellsmore
Copy link

mikelwellsmore commented Nov 15, 2022

Agreed - we need a way to programmatically retrieve or set the ID (as it looks like the password can be set via rustdesk.exe --password)

@kapytanhook
Copy link

we need to be able to set or read the ID or there is no point to this software, going to have to make my own build just to do that now.

@Onyx47
Copy link
Contributor

Onyx47 commented Dec 9, 2022

For anyone needing this functionality and is willing to build their own release, this is my current solution until there is a more definite decision on this: Onyx47@ed9e92f

It enables you to run rustdesk --id as admin/root and simply prints out the ID and quits. Certainly not sophisticated but it should do for scripting purposes. Only tested on Linux but I'd assume Windows should be fine as well, it's using the same logic as --password argument.

@knro
Copy link

knro commented Jan 18, 2023

It would be nice to be able to set/get ID as root. Any ideas if this will ever be merged in Rustdesk or we'd have to rollout our own releases?

@merlink01
Copy link

merlink01 commented Jan 23, 2023

For autologin the way anydesk does it is nice:
Load the password from stdin.

So the command is:
rustdesk.exe --connect <ID> --password
and after this:
send the password via stdin to the process followed by a \n.

On this way the password is not visible on the process list.

@knro
Copy link

knro commented Feb 14, 2023

Jumping in this issue to say it would be good to be able to get the current ID and password via the command line.

The use case is having a machine that's out in the field where there is not someone present to read off the ID and password or interact with the UI component (the UI would not even be launched). It would be good to dump these out on the command line when connected to said machine via SSH

like:

$ rustdesk --info

ID: 123 123 123
Password: abcdef

This is exactly our use case. We need to a use to programatically retrieve the ID. We can set password it's sad to see no way to get ID for field deployments. It's OK if this action is only limited to root, that's not the issue. @rustdesk When can we expect this important feature to be implemented? Onyx47@ed9e92f seems like a good solution.

@shanjunmei
Copy link

Highly recommend this, I can only precompile one client per client right now, built in id and password ,is there any body can share a document ,how to pre-config it

Repository owner locked and limited conversation to collaborators Apr 9, 2023
@rustdesk rustdesk converted this issue into discussion #3980 Apr 9, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests