You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I heavily rely on su to switch between users on my machine. One thing I've noticed is that whenever I switch users using su, I get the "Can't create the symlink for multishells" error and I cannot use node within my su process.
kevin@computer $ su testuserPassword: error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/46487_1731361529574". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/46488_1731361529575". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)testuser@computer $ nodeCommand 'node' not found, but can be installed with:apt install nodejsPlease ask your administrator.testuser@computer $
One thing I've noticed, my kevin user is userid 1000 and my testuser is userid 995. Based on the error messages, it looks like after we're now testuser, it's still trying to write to the directory /run/user/1000/ which includes the userid of my original user. This seems to be the root of the permission issues. I'm guessing that fnm is somehow using some variable that points to the original user, and not the user after the su.
Steps to Reproduce
I am able to confirm this bug on both my regular machines, but given that they might have had some weird configuration I wanted to also test against a fresh VM. I can confirm that the following steps reproduce the bug in a fresh Ubuntu 24.04.1 virtual machine.
Do a regular install of the OS
Create a second test user (using john in this case), and set the password on the test user (created the user via the gui, set the password via sudo passwd john)
Install curl sudo apt install curl
Set up user 1:
Install fnm via curl: curl -fsSL https://fnm.vercel.app/install | bash
Configure shell: source /home/kevin/.bashrc
Install a default version of node fnm install 20
Confirm that node is installed and configured node --version
Set up user 2:
Log out and log into the second user.
Install fnm via curl: curl -fsSL https://fnm.vercel.app/install | bash
Configure shell: source /home/john/.bashrc
Install a default version of node fnm install 20
Confirm that node is installed and configured node --version
Switch to user 1 and test:
Log out and log back in as the original user
Open a new terminal session and su john.
Expected
The user is able to switch to a second user without error messages, and fnm and node should be properly configured within the su session.
Actual
After successfully submitting the user's password to su, an error message is printed out:
$ su johnPassword:error: Can't create the symlink for multishells at "/run/user/1000/fnm_multishells/2706_1731363444337". Maybe there are some issues with permissions for the directory? Permission denied (os error 13)
$
Attempting to use node inside the su process fails as the executable cannot be found:
$ nodeCommand 'node' not found, but can be installed with:apt install nodejsPlease ask your administrator.
$
When I check PATH after logging out and logging back in directly, I see an entry that was missing from the path in su: /run/user/1001/fnm_multishells/2560_1731363608152/bin (and since I've logged in as the test user directly, I can successfully start node):
The main workaround I've been using is using ssh instead of su to get into the other user accounts. ssh does not exhibit this bug so fnm and node is properly configured in the new shell. This is fine, but it means I need to be running an ssh server (which I am doing anyways, but is not ideal) and my muscle memory is for su.
I did a quick search for the error message Can't create the symlink for multishells and there are a few hits in this repo. I don't think this is a complete dupe of any of the existing issues, but I assume they are related. It's a bit unclear exactly what those other users are doing that causes the issue:
Error: Can't create the symlink for multishells #938. It seems like this user is just getting the error when running as their regular user. Not sure if this is related. There's also a mention of sudo user which isn't a valid command (that would run the command user as root, which just gets me sudo: user: command not found on my machine). Perhaps they meant su user but it's not clear.
This issue also has the mention of /run/user/0 which implies userid = 0 which is always root. Perhaps that issue is specifically issues related to running fnm as root?
This one seems Mac specific and logs out a separate path (at least a different prefix). In the discussion it seems like ~/.local/state is sometimes owned by root on Macs, which would explain the permissions error. In my limited experience with Macs, I have seen mac package managers do unusual things so this wouldn't surprise me.
This one references WSL often. It seems like perhaps WSL doesn't set up the /run/user directories as expected (and/or fnm tries to do it's set up before WSL does set up those directories (assuming it does it eventually). I don't have enough experience with WSL to weigh in.
The text was updated successfully, but these errors were encountered:
Description
I heavily rely on
su
to switch between users on my machine. One thing I've noticed is that whenever I switch users usingsu
, I get the "Can't create the symlink for multishells" error and I cannot usenode
within mysu
process.One thing I've noticed, my
kevin
user is userid 1000 and mytestuser
is userid 995. Based on the error messages, it looks like after we're nowtestuser
, it's still trying to write to the directory/run/user/1000/
which includes the userid of my original user. This seems to be the root of the permission issues. I'm guessing that fnm is somehow using some variable that points to the original user, and not the user after thesu
.Steps to Reproduce
I am able to confirm this bug on both my regular machines, but given that they might have had some weird configuration I wanted to also test against a fresh VM. I can confirm that the following steps reproduce the bug in a fresh Ubuntu 24.04.1 virtual machine.
john
in this case), and set the password on the test user (created the user via the gui, set the password viasudo passwd john
)sudo apt install curl
fnm
via curl:curl -fsSL https://fnm.vercel.app/install | bash
source /home/kevin/.bashrc
fnm install 20
node --version
fnm
via curl:curl -fsSL https://fnm.vercel.app/install | bash
source /home/john/.bashrc
fnm install 20
node --version
su john
.Expected
The user is able to switch to a second user without error messages, and
fnm
andnode
should be properly configured within thesu
session.Actual
After successfully submitting the user's password to
su
, an error message is printed out:Attempting to use
node
inside thesu
process fails as the executable cannot be found:Additionally, PATH appears to be misconfigured:
When I check PATH after logging out and logging back in directly, I see an entry that was missing from the path in su:
/run/user/1001/fnm_multishells/2560_1731363608152/bin
(and since I've logged in as the test user directly, I can successfully startnode
):Workaround
The main workaround I've been using is using
ssh
instead ofsu
to get into the other user accounts.ssh
does not exhibit this bug sofnm
andnode
is properly configured in the new shell. This is fine, but it means I need to be running an ssh server (which I am doing anyways, but is not ideal) and my muscle memory is forsu
.System configuration
Host system (exhibits the bug):
Linux Mint 22 Cinnamon
System Info
Virtual machine (also exhibits the bug):
Fresh ubuntu-24.04.1-desktop-amd64.iso (sha256
c2e6f4dc37ac944e2ed507f87c6188dd4d3179bf4a3f9e110d3c88d1f3294bdc
)Related issues:
I did a quick search for the error message
Can't create the symlink for multishells
and there are a few hits in this repo. I don't think this is a complete dupe of any of the existing issues, but I assume they are related. It's a bit unclear exactly what those other users are doing that causes the issue:sudo user
which isn't a valid command (that would run the commanduser
as root, which just gets mesudo: user: command not found
on my machine). Perhaps they meantsu user
but it's not clear./run/user/0
which implies userid = 0 which is always root. Perhaps that issue is specifically issues related to runningfnm
as root?~/.local/state
is sometimes owned by root on Macs, which would explain the permissions error. In my limited experience with Macs, I have seen mac package managers do unusual things so this wouldn't surprise me./run/user
directories as expected (and/or fnm tries to do it's set up before WSL does set up those directories (assuming it does it eventually). I don't have enough experience with WSL to weigh in.The text was updated successfully, but these errors were encountered: