I've created a post-installation automation BASH script for Ubuntu installations. The last thing I want the script to do, is to set the password of UID 1000's password (the user I've created while installing the system) to expire, to force the user to change his/her password next time they log in. I guess I could use the OEM installation, but it doesn't quite fit my scenerio. I sometimes install an Ubuntu workstation for a specific person. they fill a form with the requested display name and username. I obviously don't want them, to enter the preffered password too, so I want to expire their password (a simple password I use for installing and configuring the system) to force them to change it to whatever they want at the first time they login to their newly installed Ubuntu.
PenguinCSC's questions
I am writing an installation automation BASH script. I'd like to install the nvme-cli
package only if an NVMe SSD is actually present.
I couldn't find a simple way to query the hardware (say, using lshw
) to get a kind-of-yes-or-no answer.
Any of you can give a way to extract the specific answer from within a BASH script?
I'd like to use the case
conditioning to either install it or not.
I am running Ubuntu Desktop 16.04.7 LTS inside a KVM/QEMU VM.
I manage this (and other VMs) via the virsh
CLI, including starting and shutting down the VM.
No matter what I do, when I issue the shutdown command, it hangs. When I open the console to look for the reason - I see it is stuck on the Power Menu prompt (Restart, Shutdown, etc.).
I tried to follow a few guides to resolve this and it works if I issue the command as a logged in user, but I want to shutdown the VM using the virsh
command alone.
How can I make the changes to the shutdown behavior in LightDM's settings, without any user logged in?
When I search for "logout" in Ubuntu 20.04 Desktop, I get this icon:
I'd like to add it to the launcher for all users. I can't figure out where this icon comes from, it isn't a .desktop
file under /usr/share/applications
...
So, I guess I need to create a .desktop
file to execute the gnome-session-quit --no-prompt
command, but I'd rather use a cleaner method. Any suggestions?
I want to create a BASH script to run a command after verifying a host is alive. I was thinking of using the fping
command, but I can't figure out how to create a conditional loop to proceed with running the command I need to run only if the host I am fping
ing is up. If I run the command before the host is available, I need to restart the whole machine...
During my Lab's Machine Learning Server maintenance I need to reboot it some times. The students using the server connect via SSH, run their jobs using NOHUP and then disconnect, leaving their jobs running. I need a way to check if non-system users are running anything before I reboot the server. The way I do it today is to fire up htop
and then press the u
key and then look for non-system users to see if anyone is running anything.
I want to setup a cron job to lock my session every day at three PM. When I enter dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
in a terminal window, the session locks immediately, but when I do the same in crontab (even by using a BASH script) it didn't work.
I want to create a BASH script to lock the session using dbus-send
and add it to crontab
.
I am setting up a Lab machine to be used by students, running Ubuntu 20.04.
I'd like to remove all power options from the menu, except Switch User and Logout.
I followed the instructions in this manual, and added the line disable-restart-buttons=true
to the file.
Is there something similar for the session?
EDIT: In Ubuntu 16.04 / Unity I managed the same by creating a file named 10_hide_user_list.gschema.override
, with the following lines: [com.canonical.indicator.session]
, suppress-restart-menuitem=true
and suppress-shutdown-menuitem=true
. I then placed the file in the /usr/share/glib-2.0/schemas/
directory.
I have a really weird problem: I have an Ubuntu 16.04.5 Desktop with two users, one regular and one with sudo privileges.
After I turn on the PC, it boots to the LightDM Login. If I log in to the Sudo user - all is well, but when I try to log in to the regular user (UID 1001) - the computer reboots right before showing the Desktop...
I verified the user is not locked (passwd -u
) and I also tried deleting the ~/.Xauthority
file - all it did is show me the Desktop for a split second and then it reboots...
This is a really annoying problem because I need to start working on a project in a week with this user's files.
I've setup an NFS mount in the /etc/fstab
file of an Ubuntu 16.04.6 machine.
The NFS fails at every boot, I noticed that when the Unity Greeter comes up the network icon on the top right of the screen shows the network as disconnected, and after 5 seconds it starts the connection process and succeeds. At this point, if I login and run mount -a
as a superuser, it works just fine.
I have tried a bunch of options to force systemd to wait for network, but nothing works...
How do I force NetworkManager to connect before I get to the greeter?
I don't mind the extra boot time delay.
- I have a lab of computers used by a dozen students.
- Each computer mounts a specific NFS share with a few directories in it, visible to all students.
- Some of the students need a place on the network to save their Project's data, so it becomes available on all of the lab computers.
- For security and privacy reasons, I'd like to hide the list of directories inside the shared workspace, in such a way that if a certain student executes the
ls
command, he/she can see only their own directory, thinking it is the only one there. - I remember back in the days when I used to work for an ISP using Sparcs running Unix, if a user were to try to list the contents of the /home directory, they'd see only their own (those were the times we used to give them shell accounts to access their mail using the
Pine
command)...
Anyone can tell me what's the appropriate chmod
command syntax for this?
I run a small computer lab for students, consisting of 8 computers running Ubuntu 16.04.4.
The students are not used to Linux, so they often confuse Logout with Restart and Shutdown, effectively disrupting the Lab's work flow (some work is done remotely).
I tried following the instructions in this post, but I have to repeat it using DConf Editor via the GUI for each and every user.
Executing the gsettings
commands via SSH spits out the following error:
dconf-WARNING **: failed to commit changes to dconf:Cannot autolaunch D-Bus without X11 $DISPLAY
I plan to implement the solution by running a Bash script via SSH on each of the computers.
What's the best way to approach this?
I'd like to add a file that opens Google Chrome on a specific Web page the first time a user logs in to an Ubuntu box.
I am guessing it should go in the /etc/skel
directory.
I don't know how to make it run only once, similar to the HUD Help that shows up right after the first login in Unity.
I have a post-install script I use to install a few packages after a vanilla Ubuntu 16.04 LTS installation.
One of these packages is ubuntu-restricted-addons
. I wold like to be able to install this package unattended - i.e.: without having to OK
the license.
Is there a way to add something to the script to accept the license automatically?
Say I want to install all the ubuntu-wallpapers
packages, so I would enter the following at the terminal:
sudo apt install ubuntu-wallpapers*
I am trying to get the same effect using
dpkg --set-selections < ./pkgs.txt
The problem is, this method does not support the *
wildcard in the pkgs.txt
file.
i was able to get the exact list of packages using
apt-cache search ^ubuntu-wallpapers
but I get the descriptions too. Is there a way to get only the package names so I can redirect the output to the pkgs.txt
file?
I have a Lenovo T440p laptop. I would like to be able to use ALT-F4
to close the active window in Ubuntu Desktop, but when I toggle the Fn
Keys' behavior in the BIOS, the left Shift
and CTRL
keys stop working until I toggle it back...
Any ideas?
I am looking for a way to change the default keyboard combination for changing the input language (in System Settings, Text Entry: Switch to next source:
) for each new user created on a freshly installed Ubuntu.
The default key combination is ALT+Space, and I'd like it to be the Left ALT+Shift.
I have an ISO of customized GCompris based on Ubuntu. It is intended to be burned on a CD (iso 9660 FS Type). When I try to burn it to a USB, the pendrive "becomes" a CD and it won't boot...
The guy who made this ISO as a school project a while back, says he can't remember how he made it in the first place, but it has something to do with extracting the squashfs and re-create it using chroot.
Can any of you point me to a step by step guide on how to do it - from the top?
I use multiplae panes a lot to move or copy files between panes. After Nautilus made the multiple panes disappear, I used the Webupd8's Repository so i can get that functionality back. Then, after a recent update, the context menu option to move / copy files between panes disappeared too...
It seemed to me that no one was bothered by it - because i couldn't even find any mention of the problem, so i set out to find the solution by myself, and now that I found it - I decided to share it with the community. I am sure someone found that an annoyance, like i did.
I would like to upgrade my Lenovo B50-70's BIOS. The only options for OS on the product's Site are Windows 7 and 8.
When I try to run the EXE file inside Hiren's MiniXP it claims the system battery is missing (although it's plugged in). I extracted the EXE file and found the BIOS .ROM file, but there's no way to install it. The Insyde20.exe program works only in Windows.
Obviously, I won't install a full version of windows just to upgrade the BIOS...