WSL LEAP 15.4 default user + sshd
Hi, all -- 1) How does the WSL app specify the user account as which to run? 2) How can I get sshd running to connect to my new instance? I have just installed LEAP P15.4 under WSL and am having trouble with the running user. If I let yast2 create an account, then opening the app runs a shell as that user. I don't want that UID, though, so I tried changing it, and LEAP started as root. So I wiped it all and started over and skipped user creation and created me manually, and it still runs as root. I don't see where I can tell WSL what user to be when it fires off the LEAP instance. In addition, I don't see how I can turn on sshd to support incoming connections. It wouldn't surprise me if I had to work with services in Windows, but I'd think I also need some magic inside the WSL instance. Has anyone done this? And, of course, since this is all probably WSL problems, pointers to the proper forum are welcome :-) TIA & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
On Wed, 2022-08-24 at 16:37 +0000, David T-G wrote:
Hi, all --
1) How does the WSL app specify the user account as which to run? 2) How can I get sshd running to connect to my new instance?
I have just installed LEAP P15.4 under WSL and am having trouble with the running user. If I let yast2 create an account, then opening the app runs a shell as that user. I don't want that UID, though, so I tried changing it, and LEAP started as root. So I wiped it all and started over and skipped user creation and created me manually, and it still runs as root. I don't see where I can tell WSL what user to be when it fires off the LEAP instance.
In addition, I don't see how I can turn on sshd to support incoming connections. It wouldn't surprise me if I had to work with services in Windows, but I'd think I also need some magic inside the WSL instance. Has anyone done this?
And, of course, since this is all probably WSL problems, pointers to the proper forum are welcome :-)
TIA & HAND
:-D
1) There are [probably] a few options, but I don't follow what you're trying to do in this explanation. You _don't_ want to use the user you create? At all, or with sshd? 2) I do this regularly when booted into Windows 11. I basically have a 'startup script' (via runit) which gets sshd running (in a detached tmux session) and that's how I generally interface with WSLv2 Tumbleweed. I'm not much of a Leap user (I like shiny, new things), but I see NO reason why sshd/runit wouldn't also work in Leap 15.4. You can't use sshd in the traditional "service"/"systemd" sense off of any type of (non-MS) init, that's just not how WSL works at the moment, but could change. But I do use sshd in WSL w/ about 95% of that 'this does feel like linux' feeling 😉️ -- ~ Scott Bradnick |- Windows Subsystem for Linux (WSL) Developer |-- Tumbleweed: |--- Dell Precision 5540 [NVIDIA Quadro T1000] (x86_64) |--- O-DROID H2+ [UHD Graphics 600] (x86_64) |--- IceWhale ZimaBoard 832 [Intel HD Graphics 500] (x86_64) |--- 2x Raspberry Pi 4 Model B Rev 1.2 (aarch64) |--- 1x Raspberry Pi 3 Model B Rev 1.2 (aarch64) |--- WinBook TW100 (x86_64) https://keys.openpgp.org/ :: DBC5AA9A2D2BAEBC
Scott, et al -- ...and then Scott Bradnick said... % On Wed, 2022-08-24 at 16:37 +0000, David T-G wrote: % > Hi, all -- % > % > 1) How does the WSL app specify the user account as which to run? % > 2) How can I get sshd running to connect to my new instance? ... % % 1) There are [probably] a few options, but I don't follow what you're trying to % do in this explanation. You _don't_ want to use the user you create? At all, or % with sshd? The UID was wrong. I want it to match my UID across the rest of my machines. If I could let YaST2 create it at initialization and then change it, that would be just as good. % % 2) I do this regularly when booted into Windows 11. I basically have a 'startup ... % user (I like shiny, new things), but I see NO reason why sshd/runit wouldn't % also work in Leap 15.4. [snip] Cool! Tips and pointers, please :-) Thanks & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
On Wed, 2022-08-24 at 17:23 +0000, David T-G wrote:
Scott, et al --
...and then Scott Bradnick said... % On Wed, 2022-08-24 at 16:37 +0000, David T-G wrote: % > Hi, all -- % > % > 1) How does the WSL app specify the user account as which to run? % > 2) How can I get sshd running to connect to my new instance? ... % % 1) There are [probably] a few options, but I don't follow what you're trying to % do in this explanation. You _don't_ want to use the user you create? At all, or % with sshd?
The UID was wrong. I want it to match my UID across the rest of my machines. If I could let YaST2 create it at initialization and then change it, that would be just as good.
% % 2) I do this regularly when booted into Windows 11. I basically have a 'startup ... % user (I like shiny, new things), but I see NO reason why sshd/runit wouldn't % also work in Leap 15.4. [snip]
Cool! Tips and pointers, please :-)
Thanks & HAND
:-D
So you're saying the default UID:1000 GID:100 doesn't work for you? Understandable that 1000 isn't universal, but what's stopping you for changing it 1st thing? ``` PS> wsl -u root -d openSUSE-Leap-15.4 #: usermod -u <some UID #> <your username> ``` https://docs.microsoft.com/en-us/windows/wsl/wsl-config You can use /etc/wsl.conf to set a default user if it starts using root every time going forward: ``` [user] default = <your username> ``` I'm happy to go over runit, and while it isn't complicated to use - it might be complicated to explain, but if you think of it as an alternative systemd w/ it's own setup and run commands, it's not difficult to wrap you head around. I put it together from other examples and gleaning things from systemd files. Here's the resources I have for it: https://github.com/sbradnick/runit https://build.opensuse.org/package/show/home:sbradnick/runit I'd suggest to read through that to familiarize yourself with it and maybe we can discuss it. I don't have it building for Leap 15.4 (or building at all since it hasn't been something that's changed or needed to), which I can do if you're not familiar w/ branching and building things in OBS; nothing would need to change so it'd be a branch, set to build for 15.4 and build scenario. The sshd setup is explained a bit here[1] [1]: https://build.opensuse.org/package/view_file/home:sbradnick/runit/README.SUS... -- ~ Scott Bradnick |- Windows Subsystem for Linux (WSL) Developer |-- Tumbleweed: |--- Dell Precision 5540 [NVIDIA Quadro T1000] (x86_64) |--- O-DROID H2+ [UHD Graphics 600] (x86_64) |--- IceWhale ZimaBoard 832 [Intel HD Graphics 500] (x86_64) |--- 2x Raspberry Pi 4 Model B Rev 1.2 (aarch64) |--- 1x Raspberry Pi 3 Model B Rev 1.2 (aarch64) |--- WinBook TW100 (x86_64) https://keys.openpgp.org/ :: DBC5AA9A2D2BAEBC
Scott, et al -- ...and then Scott Bradnick said... % On Wed, 2022-08-24 at 17:23 +0000, David T-G wrote: % > ... % > % > The UID was wrong. I want it to match my UID across the rest of my % > machines. If I could let YaST2 create it at initialization and then % > change it, that would be just as good. ... % % So you're saying the default UID:1000 GID:100 doesn't work for you? Yep. % Understandable that 1000 isn't universal, but what's stopping you for changing % it 1st thing? % % ``` % PS> wsl -u root -d openSUSE-Leap-15.4 % #: usermod -u <some UID #> <your username> % ``` I tried that, and from that point forward it would only open as root. % % https://docs.microsoft.com/en-us/windows/wsl/wsl-config I'll read this; thanks. Stay tuned. % % You can use /etc/wsl.conf to set a default user if it starts using root every % time going forward: % % ``` % [user] % default = <your username> % ``` Oooh! That's likely exactly what I wanted; yay. Thanks! % % I'm happy to go over runit, and while it isn't complicated to use - it might be ... % % Here's the resources I have for it: % % https://github.com/sbradnick/runit % https://build.opensuse.org/package/show/home:sbradnick/runit ... % https://build.opensuse.org/package/view_file/home:sbradnick/runit/README.SUS... [snip] Thanks! I'll read these and perhaps come back for more :-) Thanks again & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
David T-G composed on 2022-08-24 17:23 (UTC):
I want it to match my UID across the rest of my machines. If I could let YaST2 create it at initialization and then change it, that would be just as good.
Cool! Tips and pointers, please :-)
At installation, check skip user creation box, then creating password only for root. Then, on first boot: # groupadd -g 1666 evil # useradd -g 1666 -u 6666 evildoer # ls -nd /home/evildoer/ drwxrwxr-x 4 6666 1666 3072 Apr 1 1692 /home/evildoer/ # ls -dl /home/evildoer/ drwxrwxr-x 4 evildoer evil 3072 Apr 1 1692 /home/evildoer/ # passwd evildoer New password: ... :p -- Evolution as taught in public schools is, like religion, based on faith, not based on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata
Felix, et al -- ...and then Felix Miata said... % David T-G composed on 2022-08-24 17:23 (UTC): % % > I want it to match my UID across the rest of my ... % % At installation, check skip user creation box, then creating password only for % root. Then, on first boot: [snip] Tried that, too :-/ Thanks. I think that the magic wsl.conf will be my fix. Stay tuned! :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt
On 8/25/22 02:07, David T-G wrote:
Hi, all --
1) How does the WSL app specify the user account as which to run? 2) How can I get sshd running to connect to my new instance?
In addition, I don't see how I can turn on sshd to support incoming connections. It wouldn't surprise me if I had to work with services in Windows, but I'd think I also need some magic inside the WSL instance. Has anyone done this?
systemctl enable sshd should do it from memory, other then that check the port is open in the firewall, other then that it should work, I used to do it semi regularly and when I was lazy use scp for file transfer. -- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
participants (4)
-
David T-G
-
Felix Miata
-
Scott Bradnick
-
Simon Lees