`fbcon/cursor_blink` permissions reset at reboot [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
Context
I need to stop the cursor from blinking on an external screen of my raspberry-pi in order to display a home-made interface on /dev/fb0.
For this purpose I created a group cursor_blink in which I put my user and changed the permissions of the file /sys/class/graphics/fbcon/cursor_blink as follow:
chown root:cursor_blink /sys/class/graphics/fbcon/cursor_blink
chmod 664 /sys/class/graphics/fbcon/cursor_blink
So my user in the group cursor_blink can write 1 or 0 to display and hide the cursor from the screen.
Problem
I had this working, but reinstalling it on another system makes that this file is now reset to the default permissions every time I reboot, the mode becomes again 600 and the owner root:root after reboot instead of 660 and root:cursor_blink
It seems that the file is recreated (some digging in the last edit times with stat corroborate this element).
Question
Is there a way to keep the permissions as set, and prevent them of being reset ?

For the moment the solution I found is to add a crontab task to correct the permissions at boot:
crontab -e
# ...
# add this line at the end of the file :
#reboot chown root:cursor_blink /sys/class/graphics/fbcon/cursor_blink && \
chmod 664 /sys/class/graphics/fbcon/cursor_blink
Prerequisite: The group cursor_blink should be created and the user should be added to it before: usermod -a -G user cursor_blink.
If you have a better solution, feel free to add.

Related

Error applying chroot to group (groupmod: group 'www' does not exist) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
So I am trying to chroot all the users who are in group www to the directory /var/www. But I every time I try to do that, it comes back saying the group doesn't exist. (even though the group does exist)
[root#server var]# cat /etc/fedora-release
Fedora release 26 (Twenty Six)
[root#server var]# groupadd -r www
[root#server var]# groupmod -R /var/www www
groupmod: group 'www' does not exist
[root#server var]# ls -la
drwxrwxrwx. 5 root www 46 Jul 12 06:44 www
As you can see the error message is less than helpful. I have looked around on stackoverflow but haven't come across an answer to this specific question yet.
Can anyone shed some light on what I am doing wrong?
That is not what groupmod -R does. What it means is that the groupmod program will chroot into the directory, and then do everything. It’s intended for when you have one system mounted inside another, such as if you booted from a live USB drive to make changes to a broken system.
Once groupmod has run chroot, it looks in the /var/www/etc/group file to figure out what group ID www corresponds to, which of course fails because if your system is at all sanely set up you don’t have a var/www/etc/group file.
I do not know how to make sure all processes by a specific user run in a chroot, and I don’t think that’s the right way to achieve your goal. If a program is chrooted into /var/www, it doesn’t have access to any of the utilities it might expect, like the web server executable. Instead, I would look at the documentation of your web server and see if it supports this directly, or see if you can get a custom mount namespace using systemd.

How do I run `forever` from Crontab? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I am trying to schedule node server restart on OS reboot (Ubuntu 16.04 LTS). I wrote:
crontab -u username -e
then I added following line:
#reboot /usr/local/bin/forever start -c /usr/bin/node /home/username/node/bin/www
I get the success message after saving or updating this file. There seems to be no effect on server reboot.
I'd wrap that into a bash script in the user's home directory's bin.
/home/username/bin/start_my_node_app.sh
Then in your crontab...
#reboot /home/username/bin/start_my_node_app.sh >/dev/null 2>&1
Though according to this article, #reboot may not work for non-root users.
https://unix.stackexchange.com/questions/109804/crontabs-reboot-only-works-for-root

How to set up an SSH Server on OS X [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm planning on making a Bash script that sets up an SSH server. The script is only meant to work on a computer running OS X. With the research I have conducted it seems like you have to use the GUI to enable SSH. Is their a way to enable SSH through Terminal and then create a script that does so?
You can enable it from the command line (or a shell script) with:
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
You might also want to regulate access to the ssh service with the com.apple.access_ssh group:
sudo dseditgroup -o edit -a usernametoallow -t user com.apple.access_ssh
sudo dseditgroup -o edit -a otherusernametoallow -t user com.apple.access_ssh
sudo dseditgroup -o edit -a groupnametoallow -t group com.apple.access_ssh
...after which only usernametoallow, otherusernametoallow, and members of groupnametoallow will be able to ssh into the Mac.

Got an error while executing bash commands on remote ubuntu machine "no tty present and no askpass program specified" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I'm running a bash script to execute a command on a remote host. Here is the command:
ssh ppuser#10.101.5.91 "sudo mv /tmp/$2.tar.gz $1"
$1 and $2 are command line arguments. But while executing I'm getting this error : no tty present and no askpass program specified.
Hope you will help me, any help would be greatly appreciated. Thank You.
Somewhere in your sudoers file you have following
Defaults requiretty
Just comment this line - remove it. Or
Defaults !requiretty
For specific program name you can also attempt following:
Defaults </path to program> requiretty
change it to
Defaults </path to program> ! requiretty
Specific to user you can add
Defaults:username !requiretty
Adding What already have been specified in comment,
For the same you will have to
user-name ALL=(ALL) NOPASSWD: ALL
Its for passwordless sudo
Looks like you are invoking sudo, and it is not working because it doesn't have a tty bound. add
"Defaults visiblepw"
in sudoers file enables sudo even if a console doesn't allocate a tty. Use visudo on the remote machine to add this and see if this helps.
Try this command
sshpasss -p password ssh ppuser#10.101.5.91 "sudo mv /tmp/$2.tar.gz $1"

Loging with SSH with a different user, shows no current path [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am trying to get a server up and running, there is no problem when I am using my root user, however when I created a new user and I log in with him instead of getting
user#internet:/$
I am only geting $ and I can't see the folder in which I am.
The server is running ubuntu if that helps.
Your new user is probably using a different shell. You can check by typing $0 at the prompt in each.
It sounds like root is using bash and your new user is using sh, but do the above to check.
If you want to modify the login shell for your new user, use usermod with the -s flag:
usermod user -s /bin/bash
The above would set the default shell to bash.
It's because your user runs sh as default shell.
Run as root:
chsh -s /bin/bash your_user
And login again.

Resources