Can't connect to am62 board after removing torizon user

Hey all, I’ve had the torizon user on my am62 board for a while, and I wanted to change that. I created a new user on my board and deleted the old one. Ever since doing this I had issues with trying to run a container on the board with the VsCode IDE.

If I input my new username and password, I get a “trying to connect” message at the bottom with a spinner, but after several minutes, nothing will happen. If I put in an incorrect password or try to use the old user, I get an expected “Error trying to connect to verdin-am62-15133439 : All configured authentication methods failed”.

I’m able to ping my board’s ip address, and I can connect to other boards I haven’t done this to. I can also PuTTY into the board and login just fine. What is my issue here?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake:

It seems like the issue might be related to the permissions or configurations that were set for the torizon user, which are now missing for your new user. Here are a few steps you can try to resolve this:

  1. Check User Permissions: Ensure that your new user has the necessary permissions to run Docker containers and access the required files and directories. You can add your new user to the docker group with the following command:

    sudo usermod -aG docker <new_username>
    
  2. SSH Configuration: Verify that the SSH configuration allows your new user to connect. Check the /etc/ssh/sshd_config file to ensure that the new user is not restricted.

  3. VSCode Configuration: Update the VSCode settings to use the new username. Go to the Torizon extension settings in VSCode and update the SSH username and password to match your new user.

  4. Restart Services: Restart the SSH and Docker services to ensure that all changes take effect:

    sudo systemctl restart ssh
    sudo systemctl restart docker
    
  5. Check Docker Permissions: Ensure that the new user has the correct permissions to access Docker. You can test this by running a simple Docker command:

    docker ps
    
  6. Re-add the Torizon User: If the above steps do not resolve the issue, you might consider re-adding the torizon user temporarily to see if the problem persists. This can help identify if the issue is specifically related to the user change.

If these steps do not resolve the issue, please provide more details about any error messages or logs you encounter during these steps.

Best regards, Toradex AI Assistant

I did need to grant my new user permissions for docker it seems, but I still cannot send the container to the device. When I run “sudo systemctl restart ssh”, i get a “Failed to restart ssh.service: Unit ssh.service not found.” error.

Greetings @jeatontenney,

Before I look into what’s happening on the VSCode side. I have some questions to help me understand your situation.

How exactly did you delete the torizon user?

How exactly did you add your new user?

Finally, why exactly did you remove the torizon user in the first place?

Best Regards,
Jeremias

I first added a new user with:

sudo adduser <news_username>

then granted it access with

sudo usermod -aG sudo <new_username>

I migrated the older files into this new user and deleted the old user. It was a few days ago now so I can’t remember the specifics of why I went this way, but I think it had something to do with a process running that wouldn’t allow me to change that user info? Do you think I should reinstall the image and change the original user?

Do you think I should reinstall the image and change the original user?

I would strongly recommend not removing the torizon user completely unless absolutely needed. If you recall specifically why you removed the torizon user then I can discuss and provide my opinion on whether it’s the right approach or not.

In theory the VSCode extension should not actually care what user is on the device or not. But based on what you’ve said so far it’s possible something wasn’t transitioned correctly when you added the new user and “deleted” the old one.

I migrated the older files into this new user and deleted the old user.

Just to understand. What do you mean “migrated the older files”, what files are you talking about here?

And, how specifically did you “delete” the torizon user?

Best Regards,
Jeremias

Hey Jeremias! I’ll give a small update before I answered those questions. I went back to an older image that had the torizon/torizon user and password, changed the password only, and I was able to connect to the board again that way through VSCode. So it definitely sounds like something with the new user and not transferring all the user files over correctly. If anything, let this post be a warning to others, don’t go about making a new user in the same way I did.

I’m pretty sure the way I transferred files over was through the following:

sudo rsync -av /home/olduser/ /home/newuser/

where olduser was torizon and newuser was my newly generated user.

I then changed ownership of those files using:

sudo chown -R newuser:newuser /home/newuser/

hope this helps.

I’m pretty sure the way I transferred files over was through the following:

What files were you transferring from the torizon home directory to this new user home directory?

On my setup if I create a new user using the commands you gave. Then I add my device to VSCode using this new user, I don’t have any errors or issues. But, it also doesn’t seem to add my device, it just kind of hangs forever without success or failure. If I add my device using the torizon user then it succeeds as expected.

Maybe this is related to what you were experiencing before. Let me ask our IDE extensions team about this.

Best Regards,
Jeremias

What you’re experiencing is exactly what’s happening to me, sorry for not being clear on that! It never succeeds for fails, but there is the loading spinner at the bottom of VSCode saying its trying to add the device.

To answer your question, it doesn’t appear like there’s much in that directory I was trying to copy over. From what I can tell it was just a docker-comose.yaml file.

Do let me know if the IDE team has any insight into this, thanks!

Okay, so I reported this to our IDE team along with my findings. They believe this to be a bug of some kind. A ticket was made in their backlog to eventually investigate and fix/improve this behavior.

For the time-being you’ll need to add the device to VSCode using the default torizon user.

Best Regards,
Jeremias

Thanks for your help Jeremias! Last question for you while we’re on this topic: I’m familiar with changing usernames using the following linux command:

sudo usermod -l new_username old_username

Would doing this cause similar issues with the board hanging forever without success or failure if we tried connecting to it via the new username?

Would doing this cause similar issues with the board hanging forever without success or failure if we tried connecting to it via the new username?

From what I understand it would still have the issue, since the core issue is that the extension expects a user with the exact name torizon. Any other name will result in the same failure to connect.

Now the good news is that our team just released version 2.6.0 of our VSCode extension. I’m told this version should have a fix for this issue here. Could you give this a try and let me know.

Best Regards,
Jeremias