Skip to content
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

[BUG] Not Able to Connect to Distributed Server - Private Key Encrypted Error #839

Open
Jasper987S opened this issue Dec 4, 2023 · 5 comments
Labels

Comments

@Jasper987S
Copy link

Describe the bug
After installing just CORE, I try to run a simple two-PC scenario. Without setting the server in the "Session>Servers" page, I am able to start the scenario without issue and ping between the two nodes. However, once I set the server in the "Sessions>Servers" page, and try to re-run, I get an Error "Exception calling application: Private key file is encrypted".
image

I set up my ssh client and server as instructed in the documentation and made sure to create an /etc/fabric.yml file with the absolute path to the private key, also as instructed. I am able to ssh to root@core3 without password. Note: (core3 is the hostname of the distributed server. This was added to the /etc/hosts file in the master)

An error is raised by paramiko in the output from the core-daemon, specifically a PasswordRequiredException.
image

I did a little experimentation and added a passphrase item to the fabric.yml dictionary with the passphrase and the following error was output.
image

Not sure how my configuration is wrong, as I followed the instructions provided in the documentation.

To Reproduce
Steps to reproduce the behavior:

  1. Fresh install of CORE. I did not install EMANE or the bindings yet. I am just interested in confirming a good distributed CORE setup. See install process in Additional Context section.

  2. Modified the /etc/core/core.conf file by uncommenting the "distributed_address" line and changing address to that of the primary/master server that connects to the distributed server. All other parameters were left unchanged.
    image

  3. Ran core-daemon and core-gui.

  4. Create a two node setup with two PCs and connected them with a link.

  5. Added the "core3" server to the Session>Servers page. The address of core3 (the distributed server in the setup is 192.168.100.3)
    image

  6. Press the start button.

Expected behavior
CORE scenario start without error.

Screenshots
See above.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • CORE Version 9.0.3
  • EMANE Version - Not Installed

Additional context
Installed from package for the primary/master server (core_9.0.3_amd64.deb) and (core-distributed_9.0.3_amd64.deb)
Package Installation process:
For Master
• sudo apt-get update -y
• sudo apt-get install -y ca-certificates python3 python3-tk python3-pip python3-venv libpcap-dev libpcre3-dev libprotobuf-dev libxml2-dev protobuf-compiler unzip uuid-dev automake gawk git wget libreadline-dev libtool pkg-config g++ make iputils-ping tcpdump
• cd /tmp/ <--- I had to do this because apt was complaining about permissions if installed from home directory (even after chmod and chown changes)
• To download use “wget https://github.com/coreemu/core/releases/download/release-9.0.3/core_9.0.3_amd64.deb .”
• Run: sudo apt install ./core*.deb
• cd /opt/core/
• sudo python3 -m pip install core--py3-none-any.whl

After, I added the alias and path variables to the ~/.bashrc file to the correct venv path.
I also created the

For Distributed:
• sudo apt-get update -y
• sudo apt-get install -y ca-certificates python3 python3-tk python3-pip python3-venv libpcap-dev libpcre3-dev libprotobuf-dev libxml2-dev protobuf-compiler unzip uuid-dev automake gawk git wget libreadline-dev libtool pkg-config g++ make iputils-ping tcpdump
• To download use “wget https://github.com/coreemu/core/releases/download/release-9.0.3/core-distributed_9.0.3_amd64.deb .”
Downloaded to /tmp/ and install from there to avoid warnings.
• Run: sudo apt install ./core*.deb
• Installed openssh-server

For Key Setup on Master, Used:
• sudo apt install openssh-client
• ssh-keygen -o -t rsa -b 4096 -f ~/.ssh/core
• ssh-copy-id -i /home/coreemu/.ssh/core root@core3
NOTE: core3 is the hostname of the distributed server

@Jasper987S Jasper987S added the bug label Dec 4, 2023
@bharnden
Copy link
Contributor

I can only assume you modified the ssh configuration on the distributed system correctly, that is to avoid needing a password.

https://coreemu.github.io/core/distributed.html

In particular this section:

# open sshd config
vi /etc/ssh/sshd_config

# change configuration for root login to without password
PermitRootLogin without-password

# restart sshd
sudo systemctl restart sshd

@Jasper987S
Copy link
Author

Thanks for the feedback @bharnden. I think the issue is that I am generating an encrypted private key and paramiko cannot read it without the passphrase. I ended finding a temporary way around this issue by providing the passphrase in the fabric.yml file. Also, I had luck connecting to a distributed server, but that server was a master core install. Core-distributed did not work for me. Not sure what I am doing wrong.

@bharnden
Copy link
Contributor

You would have to expand on that more, any distributed server, only needs to be core-distributed, but a master install could work as all it really needs are some tools installed on the system and vnoded/vcmd.

@Jasper987S
Copy link
Author

Thanks again! So beside installing the core-distributed... package, I have to install some other dependencies? Sorry, it is not clear to me what the install process for the core-distributed package is and to what extent it differs from the master core package install process.

@bharnden
Copy link
Contributor

core-distributed defines its dependencies, they are a part of the package install.

distributed does not actually include CORE itself, just some commands to orchestrate nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants