Sample Header Ad - 728x90

Remmina RDP connection from Bash without encrypting password or creating profiles?

2 votes
1 answer
2303 views
How can I connect to a machine via RDP using Remmina? I understand that I can do: remmina -c "rdp://Administrator@192.168.122.2" But then I have to enter the password which I don't want to do. Remmina does appear to support this format as well: remmina -c rdp://username:encrypted-password@server But my Bash script needs to be fully automated and I couldn't find a way to encrypt the password without interaction. Besides that, the password encryption seems to rely on other system services that I'm not even sure are necessarily available. When I run remmina --encrypt-password for the first time, it just prints this message: Load modules from /usr/lib64/remmina/plugins Remmina plugin glibsecret (type=Secret) has been registered, but is not yet initialized/activated. The initialization order is 2000. The glibsecret secret plugin has been initialized and it will be your default secret plugin instead of letting encrypt a password. I'd also like to avoid generating a profile just for that. Encrypting the password doesn't benefit me in any way btw because this is just for a local connection to an unimportant virtual machine. The only reason I'm even using a password is that Windows doesn't allow password-less RDP. **Edit:** The best I was able to come up with so far is: RDP_USER=Administrator RDP_PASSWORD=admin RDP_HOST=192.168.122.2 # Run it once because the first time it prints a useless message instead of actually encrypting echo "$RDP_PASSWORD" | remmina --encrypt-password &>/dev/null # Run it again, hoping it always works the second time ENCRYPTED_PASSWORD="$(echo "$RDP_PASSWORD" | remmina --encrypt-password | grep 'Encrypted password: ' | cut -d':' -f2- | tr -d ' ')" remmina -c "rdp://${RDP_USER}:${ENCRYPTED_PASSWORD}@${RDP_HOST}"
Asked by Forivin (1193 rep)
Aug 19, 2021, 11:39 PM
Last activity: Mar 23, 2022, 07:49 AM