The small linux problem thread

I just wrap it in a su -c ' '

Skinning a cat, I guess.

Thatā€™s what I love about linux and other unix-like OSes, thereā€™s always more than one way to do it. Itā€™s mostly muscle memory after youā€™ve been using it for a while.

Edit: And I like using sudo because it can keep a log. Just a personal preference.

3 Likes

i keep seeing people use sudo su - which is technically wrong as - means your piping a command to be run from stdin

echo "whoami" | sudo su - will return root :woman_facepalming:

there is the history command though. Works for root; though you have to be logged into the root account to see it.

So whether you log into root to do you stuff, or have an elevated account which uses sudo makes no difference.

I actually prefer having a root account, and then muck around in userspace so I donā€™t break anything.

1 Like

But sudo can be used for much more than just getting root privileges. Once you start using it to do things with the rights of multiple users or groups, and youā€™re one of many people who do that on a system, checking history files becomes unmanageable.

Plus, history files donā€™t have timestamps. If you want to know exactly what happened at a certain time, checking them is quite useless.

No, su - is equivalent to su -l :

   -, -l, --login
          Start the shell as a login shell with an environment similar to a real login:

             o      clears all the environment variables except TERM

             o      initializes the environment variables HOME, SHELL, USER, LOGNAME, and PATH

             o      changes to the target user's home directory

             o      sets argv[0] of the shell to '-' in order to make the shell a login shell
3 Likes

Thanks for the clarifaction. Dont know where i got the - part from then. Always see - being passed to indicate piping from stdin

Well, it would make more sense if it did, because as you say, basically every other command uses it to accept input from stdin. Just one of those inconsistencies that makes administering a linux/unix system unneccessarily complicated.

1 Like

or when commands cant decide between -r and -R for recursive so you end up guessing have the time.

it kinda does but its my fault for not check further. echo "whoami" | sudo su - will return ā€œrootā€ regardless of whether or not - is used

1 Like

Or when you work on multiple different UNIX-like OSes and the GNU and BSD versions of certain commands use completely different commandline switches to do the same thing. Or when itā€™s an embedded system and ifconfig suddenly doesnā€™t have a -a switch.

Fun! :wink:

1 Like

Ahh yeah that makes sense. Iā€™ve never been part of a multi user unix system though. Only thing I ever use it for are updating and installing new software.

I need some help with a samba share.

I have an ubuntu server that connects with our ADDC to auth users to the share. That part works perfectly. The problem is when a user creates a file on the share only they have access to modify, delete, etc. I have the domain users group added to the valid users line and write list line but they only ever get read and execute.

I would like the permissions to be more windows like in that everyone in the domain users group has access to delete/modify files unless otherwise specified. I could go through in windows to make this change but it wont take effect on new files created. I assume linux permissions dont inherit from the parent folder like windows does.

I tried to RTFM but im not sure what line, if any, I can add to my config to make this happen.

EDIT: I think perhaps ā€˜create maskā€™ might do what Iā€™m looking for?

EDIT2: I added create mask = 0766 to the share but it still results in only read execute.

EDIT3: I got create mask to work properly as well as figuring out how to make permissions inheritable. My problem is the file which I was sharing needed permissions at least as high as the ones I was trying to give via smb. I am actually an idiot and never looked at the file perms in linux before trying to make samba give them.

1 Like

Weird thing that I donā€™t have an answer for other thanā€¦ its apple.

I have a cinema display as my main monitor with a dell screen as secondary. When I rotate the dell screen in xrandr or monitor settings the main screen glitches out. If I do landscape everything is fine.

And maybe its driver problems that I need to patch myself and submit, IDK yet.

ps aux vs ps -aux
That was the bane of my existence for a while switching between Solaris, Red Hat, and MacOS X.

Thanks for providing the solution to your issue. Also, that permissions issue is a mistake that you will hopefully only make once.

1 Like

It seems so obvious now but man do I feel dumb for spending as much time as I did on trying to figure it out.

How does one check the version of kernel modules in a given kernel?

Eg. Iā€™m interested in the latest k10temp module which I compiled from github, but Iā€™d like to know when itā€™s included in an updated kernel version used in a distro.

modinfo doesnā€™t have version. Thereā€™s a field called ā€œvermagicā€ but that contains the kernel version.

May be a dumb question, but I am having problems with installing Fedora on a new (to me) motherboard and mSATA SSD.

When I set UEFI Boot to Enabled and then select the UEFI USB in the boot device menu, I get:

exit_boot() failed!
efi_main() failed!

The ISO I used to create this boot USB is a bit suspect to me, as when I installed Fedora on this board just a bit ago using the old fashioned LEgacy BIOS boot mode it never gave me the option to set up users when installing. On reboot it logged in immediately and I couldā€™t do anything.

When I was booted to the Live CD (again, under Legacy BIOS) Fedora thought there were two monitors. This board has at least one (possibly two) LVDS headers in addition to an HDMI and DisplayPort. For some reason Fedora is seeing the LVDS as a monitor (even though nothing is attached) and sets that to the default monitor. I can right click and set the HDMI monitor as default, but then it moves the screen settings window to the non-existent display. I could hit Activities in the upper left and start the install process, but then I came across the weird no users setup issue.

I donā€™t know. If anyone has any ideas on the initial UEFI problem, thatā€™d be great. Iā€™ll download a fresh copy of Fedora overnight, in case thatā€™s the problem. It takes me an hour or more to download 1.7GB, and I didnā€™t feel like tying up my bandwidth all evening.

EDIT: I was able to disable the LVDS in the UEFI, so the annoying two monitor issue is no longer an issue.

you could just verify the iso integrity before you waste the bandwidth downloading

2 Likes

Checked the hash and it matches. Test and boot works fine too.

Just canā€™t boot in UEFI mode.

And I just tried doing another install after booting in legacy mode and I still donā€™t get the option to create users while itā€™s installing stuff.

1 Like