date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,307,090,858,000 |
Is there a way to create a user account in Solaris which allows the users to run one command only? No login shell or anything else. I could possibly do it with /usr/bin/false in /etc/passwd and just get the user to ssh <hostname> <command>, but is there a nicer way to do it?
|
You could used a forced command if the users can only connect through ssh. Essentially, whenever the user connects through ssh with a certain key and a certain username, you force him to execute a command (or a script or) you determined in the .ssh/authorized_keys. Commands issued by the users will be ignored.
For exa... | Creating a UNIX account which only executes one command |
1,307,090,858,000 |
I need to perform backup of a server to my computer using Duplicity:
duplicity /etc sftp://[email protected]//home/backup
Before this can be done, I need to allow password-less access by doing the following:
$ ssh-keygen
$ ssh-copy-id [email protected]
$ ssh [email protected]
My question is, how do I restrict the co... |
Question #1
My question is, how do I restrict the command to just this SFTP transfer in the public key that is generated?
There are 2 methods for doing this.
1. -- Restricting through sshd
This method involves setting up the SFTP feature within your SSH daemon, sshd. This is controlled through the /etc/ssh/sshd_con... | Restrict password-less backup with SFTP |
1,307,090,858,000 |
The Glassfish application server provides scripts to administer the application server and also start and stop them and I would like to restrict the root user from running this script. The reason is that some key developers forget to administer the server as the non-privileged user and if they restart the application ... |
Similar to the other answers, but in the direction you wanted.
if [[ $EUID -eq 0 ]]; then
echo "This script must NOT be run as root" 1>&2
exit 1
fi
Alternatively, you can use sudo within the script to force execution as the non-privileged user using the -u flag to specify the user to run as. I don't use Glassfish... | How to hinder root from running a script |
1,307,090,858,000 |
Using command="" in authorized_keys, I can restrict the commands that can be run by a particular key.
What commands do I need to allow in order to have a functioning git remote?
From the Pro Git book I can infer that git-upload-pack and git-receive-pack are required, but is there anything else?
Note I still want to be... |
Git includes a git-shell command suitable for use as a Git-only login shell. It accepts exactly the following commands:
git receive-pack
git upload-pack
git upload-archive
git-receive-pack
git-upload-pack
git-upload-archive
cvs server (used for emulating a CVS server, and not required for the Git protocol... | What commands does git use when communicating via ssh? |
1,307,090,858,000 |
I've got a remote server my.server.com and I'd like to allow another user (stranger) to scp files onto the box.
Goals:
give as little access to the stranger user as possible
stranger should not be able to log in at all
if possible, arrange one-way copying - they should only be able to copy files onto the sever, not o... |
If you want all setup all the limiting stuff you mention I would suggest to use ProFTPd.
Using the sftp_module you are able to only allow a secure session. See http://www.proftpd.org/docs/contrib/mod_sftp.html for details about the sftp functionality. Near the bottom of the page an example configuration is listed.
Us... | How can I set up one-way scp? |
1,307,090,858,000 |
I would like to lock down an Arch Linux user account to the maximum extent possible. The only functionality required for the account is to accept a non-terminal SSH session which allows the client to create a tunnel to the internet.
The situation is that I want to share my remote connection with a few friends. I wil... |
When you add keys to an authorized_keys file you have several options to restrict what that key can do. In this situation, you can disallow running any commands. Simply prefix it with command="".
For example:
command="" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDc7nKsHpuC6W/U131p0yDh455sLE9pWmFxdK...
When the user wants ... | How can I lock down a user account to the point that it can read/write/execute as little as possible? |
1,307,090,858,000 |
In Linux distributions like RedHat you can create a user with options --disabled-login and ---disabled-password (see man page for command adduser link).
I wonder if it is possible to check for an administrator after user creation if the login and password is disabled for a given user? Exists there any possibility?
|
This information can be gathererd using the passwd utility.
From man passwd
-S, --status
Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password
(L), has no password (NP), or has a u... | How to check if unix account has been created with "--disabled-login" and "---disabled-password" |
1,307,090,858,000 |
Linux box a is connected to a home DSL line with dynamic DNS registration, hosting a tmux session to which multiple clients connect in read-only mode over SSH. All users connect using the same credentials: user b.
Example: ssh [email protected] tmux attach -t screencast
It all works fine but I have had a user do "nau... |
I don't completely understand your requirements: which machine are the users to be jailed on? Can they do anything that doesn't involve the network? Nonetheless I think I can tell you what the necessary building blocks are.
To restrict a user to specific network connections, see
How to restrict internet access for a p... | How to "jail" a user account's network capabilities on Linux? |
1,307,090,858,000 |
I know how to restrict standard users to run a command by removing execute permissions for that command. But it's possible restrict standard users to run a command with a specific option/argument?
For example a standard user should be able to run the following command:
ls
but not:
ls -l
I think that this can be poss... |
I think the only way would be to write your own wrapper to the command/utility in question and have it decide what is allowed or not allowed based on the (E)UID of the user who started it. The tools you mention that do this such as chsh or passwd have this functionality built into their implementation.
How to write a ... | Restrict standard users to run a command with a specific argument |
1,307,090,858,000 |
I'd like to use a passwordless key to perform e.g. unison synchronization while being able to SSH into the server only with a password-protected key. The usual way of using scponly is changig the login-shell of my server account, but that is too global. Can an entry in authorized_keys achieve this instead?
|
You can use command keyword in authorized_keys to restrict execution to one single command for particular key, like this:
command="/usr/local/bin/mysync" ...sync public key...
Update:
If you specify a simple script as the command you may verify the command user originally supplied:
#!/bin/sh
case "$SSH_ORIGINAL_CO... | How to associate only one public key with a restricted shell like scponly? |
1,307,090,858,000 |
I have a machine running Ubuntu 12.04 LTS with OpenSSH server installed. I have created a user with a jailed home account.
When I log in with the user's account, I can only access his home (duh).
In addition to the user's home folder, I would like to give the him read access to a particular partition (/Volumes/Stora... |
You will need to ensure that the chroot that the users is put in has access to the directory by bind mounting into the chroot tree:
mount --bind /Volumes/Storage /path/to/chroot
The user will also need to have necessary filesystem permissions to read the data on the drive. The easiest way to accomplish this would be ... | SFTP: give user access to folder outside home |
1,307,090,858,000 |
I have a small problem. I have two accounts on a PC. One is used for "normal" operations, usually through the graphical interface, the other is only used for remote management (upload files through sftp, execute through ssh)
Now, I'd like to disable the local login for the second account and allow it to be used only t... |
You could create a group for the users you want to be able to log in graphically (just to make it easier if you decide to add another user later). I'll assume graphical-users, but the name doesn't matter.
Add the group: addgroup graphical-users
Add your normal user to this group: adduser frarugi graphical-users.
Edi... | Force login through ssh only |
1,356,445,124,000 |
I am using /bin/rbash for some users. It's working as expected but there is some hack like when users run bash or dash, then they got unrestricted shells, so to avoid these commands, I have added below functions in their .bashrc files.
bash() {
echo "WARNING: NOT ALLOW!!"
}
sh() {
echo "WARNING: NOT ALLOW!!"
}
So my... |
Do not do this. rbash should only be used within an already secure environment unless you know what you are doing. There are many ways to break out a restricted bash shell that are not easy to predict in advance.
Functions can easily be overridden simply by doing command bash or command sh.
As for your questions:
You... | Bash restricted Shell using rbash |
1,356,445,124,000 |
I'm trying to create a guest account in arch linux that only allows the user to use simple applications like firefox. I do not want them to have access to programs like terminal or grub-customizer etc. How would I do this?
|
In the case of gnome - please use the following as a support in getting where you want to be.
Security
Disable access to any command line
https://help.gnome.org/admin/system-admin-guide/stable/lockdown-command-line.html.en
Ensure that the installation works as wanted before activating this
or ensure that one can log i... | Create guest account with restricted access to applications |
1,356,445,124,000 |
I am trying to secure a custom application as much as possible from outside tampering.
I've seen many pages on jailing a user, but they usually include many exceptions, and I want to lock down this user as much as possible.
The user only needs to execute an application that is a websocket++ client & server that needs ... |
if you really
want to lock down this user as much as possible
create a virtual machine. The chroot don't really isolate this process.
If a real virtual machine is too heavy, maybe you can have a look at linux containers, a lightweight version of virtual machine. Harder to configure though.
If you want something even... | Absolutely jail a user with minimum IP, file, & command rights |
1,356,445,124,000 |
It's clear from documentation about cron that if cron.allow and cron.den both exist then cron.allow takes precedence and it is allowed.
What is the case for at.allow / at.deny?
Everywhere I've searched and checked does not say it explicitly.
I use Ubuntu.
|
The FreeBSD and Solaris manuals are clear: if at.allow exists, at.deny is ignored. The Linux manual is slightly less explicit but the behavior is the same.
Despite the convergence of BSD and Solaris, this is not universal. On AIX, if a user is listed in both at.allow and at.deny, then he cannot use at.
| at.allow and at.deny precedence (in Ubuntu)? |
1,356,445,124,000 |
I've created a local port forwarding and I was trying to ssh into my own port.
During the process, I found that my own Linux won't recognize me even when I have the right password
chulhyun@chulhyun-Inspiron-3420:~$ su
password:
root@chulhyun-Inspiron-3420:/home/chulhyun# ssh root@localhost -p 2200
root@localhost's pa... |
This is an answer that I finally reach after the discussion made in the comments.
From the comments, I realized that connecting to port 2200 is in fact an attempt to log in to the remote destination server. Based on this discovery, not only was I typing in the wrong password, but also, I was trying to log in with the ... | Linux can't recognize the right password when ssh'ing? |
1,356,445,124,000 |
Is it possible to have bashrc grab every single command the user types, save for those containing a given word?
Like the way you can use aliases to change what the user meant, you can alias for instance 'cd' to nothing. that way the user can't apply that command anymore.
Maybe that way you can have a given user only a... |
If you only need users to access files remotely with sftp or rsync, but not be able to run shell commands, then use rssh or scponly.
If you need users to be able to run only a few programs, set a restricted shell for them, such as rbash or rksh. In a restricted shell, PATH cannot be changed and only programs in the pa... | Bashrc disable-ing all but a given command for a given user |
1,356,445,124,000 |
I have a (home) Ubuntu machine; upon installation I created the "x" user during the installation (who is not the root) so often when I want to run apt-get or other things that require write access to /usr or /var I need to sudo.
My question is is there a safe way to setup the "x" user in such a way that he has more ri... |
Not on Linux. On Solaris you can use RBAC (Role Based Access Control) and provide additional permissions.
On Linux the proper way to do this is to use sudo.
We all do it.
That is the way of things.
The way of the Force.
| Optimal way to setup user account / accesses? |
1,356,445,124,000 |
I've created a SSH folder for some friends. I've created the users to log in via SSH, but they connect to ~ how can I set to which folder they can connect?
I have a directory called /usbdrv/ which point to my usb Drive.
PS: They can't go then in the parent directory.
|
Setting a user's home directory only determines the directory where they are by default. Users can see the rest of the filesystem.
If you want an account to be restricted to file transfer and to only have access to a specific directory tree, you need to “jail” that user. This is supported natively by OpenSSH; for exam... | Create a user that can only connect to a specific directory |
1,356,445,124,000 |
When I work on Linux test server (Debian 11) I have root, and want block other users open new session to this server during my work.
Is it possible?
|
When you are logged in as root, you can create a file named /var/run/nologin (historically /etc/nologin), and this should prevent non root users from logging in. When you are done your work as root, you can then delete that file to resume access to other users.
See the man page for nologin (5):
Name
nologin - preven... | How to prevent other users from creating new SSH sessions? |
1,356,445,124,000 |
I'm setting up an Ubuntu server to receive ssh connections from clients so I will then be able to connect back to their machine (reverse SSH tunneling). I searched for a way to prohibit any action from the client on the server, and I found different solutions, but none seems as simple as just configuring the authorize... |
If the restriction is for a number of users I would set up a Match block in /etc/sshd_config, to apply restrictions for that group of users. If the restriction is for a particular ssh key I would consider taking your suggested route and blocking commands in the ~/.ssh/authorized_keys file.
Match block in /etc/sshd_con... | Using sleep command in ssh authorized_key to prevent user's actions |
1,356,445,124,000 |
Assume you can install something on a system because you have sudo rights to do so, but only have sudo rights for the installer. In that case it is fairly easy to create a package that installs a binary owned by root that has the setuid bit set during installation, and have that binary execute any command that you fee... |
This is probably doable with an SELinux policy (and probably not doable without SELinux or other a security module that can confine root), but it's pointless.
As you note, a package could declare that it installs /etc/sudoers. Even if you make an ad hoc rule to somehow prevent that, the package could drop a file in /e... | Disallow `apt-get`, `yum` to install setuid binaries when itself run via sudo |
1,356,445,124,000 |
I have a linux machine(kubuntu 13.04)
A my friend asked me give him an account with being able to use sudo. So, I made an account for him and put the account in /etc/group for him to use sudo
I don't care he installs or manages any programs but don't want him to access my home folder /home/myaccount and its sub folder... |
Probably, you can not. If he has "full root privileges" (and the needed knowledge), he'll can circumvent any limitation you can impose him.
Try to reverse your approach: He needs full root privileges? Why? Really? Give him sudo privileges only to minimal required set of command. E.g. To install an application by packa... | How do I isolate my file system data from another system root? |
1,356,445,124,000 |
I have a problem, I need to give an access to someone, but the only way to connect to the database is via SSH, so if I have understood everything correctly, I need to create him a linux account (on a Debian 10 machine), the user created doesn't have any right to write in folder, so I guess he can't break anything.
But... |
What you asked for...
What you are looking for is chroot. This will set the / root of the filesystem to a location of your choice.
If you chroot to /home/bob for the user bob this location will look like / for bob. He will not see the rest of the filesystem. Because of this you want to place any programs he needs to r... | Removing commands from a specific user |
1,356,445,124,000 |
I want to use an existing Ubuntu machine (with a public IP) to allow a user to SSH into it and then use it to SSH/RemoteDesktop/FTP into another linux machine (with a private IP but within the 1st machine's network).
I would create a new user account for this purpose, but I want to:
Restrict sudo access to this user... |
What you are trying to setup is usually called a jumpbox.
Users are not added to the wheel group automatically, so you only need to useradd the new user, and you are good to go
| SSH and SCP piggyback ubuntu machine for a new user |
1,356,445,124,000 |
Background: We have a policy in the company to deactivate the login possibility as much as possible, which is understandable.
I am just wondering if there are any other side effects if you specify /usr/sbin/nologin as the login shell of an account? Apart from the login capability are there any other capabilities or fe... |
Most daemons will reject user access for users whose shells don't appear in /etc/shells (and those that authenticate using PAM can be made to do so with a line of configuration). But you'll need to check the ones you care about (FTP daemons, IMAP server, etc) to make sure their behaviour is what you want. You may ne... | Does /usr/sbin/nologin have any side effects? |
1,356,445,124,000 |
A small family setup...
I have a color printer, and a Linux computer, with CUPS installed. I wan to allow the kids to print, but only in draft mode, and only in greyscale.
With CUPS I prevented the kids' account from accessing the printer. Then I set up a second printer, for the same hardware printer, but with differe... |
So, with meuh's help, it was actually quite easy to implement a working solution.
Edit the printer's PPD, locate the GUI entries concerning the color setup and printing mode, and comment out the unwanted options (comments are lines starting with *% in a PPD file).
In my case, it was :
*OpenUI *ColorModel/Output Mode: ... | Is it possible to prevent users to modify printer options in CUPS? |
1,356,445,124,000 |
I have a server where MAXWEEKS is set to 13 in etc/default/passwd. I know that this setting means that password will expire after 13 weeks. My question is if the user does NOT change the password, does the account become locked out after this or does the system will force the user to change the password when the user... |
The MAXWEEKS only sets the amount of time a certain password may be used before the user if forced to change it. The user will get a prompt with a request to change the password before the user can further login to the system.
Locking of an account after a period of inactivity requires a more advanced authorization ma... | MAXWEEKS on Solaris is equals to 13 |
1,356,445,124,000 |
I am new to linux and interested in only allow in login via direct access to the machine (active user). I don't even want to be able to log in remotely myself. Can someone please point me in the right direction on how to do this? I am using Ubuntu.
|
By default, Ubuntu doesn't allow anyone to log in remotely – you'd need to install a server for that (for example, for an SSH server, the openssh-server package), and then activate it.
So, unless you're explicitly doing that, nobody can log in remotely.
If you already did install such a server, you can either uninstal... | How to lock down Ubuntu linux so that only the active user can log in |
1,356,445,124,000 |
I need to create a user which can SSH to a server, but can not run any commands or view anything, for the purposes of tunneling the connection without risk of revealing credentials. How do I do this? I looked on google but found no sources.
Edit: Would it also be possible to show a certain message to the user upon lo... |
Sleepshell http://www.mariovaldez.net/software/sleepshell/ or
rbash http://en.wikipedia.org/wiki/Restricted_shell
could be you need.
| How to create user with only SSH permissions [duplicate] |
1,456,364,840,000 |
Why do open() and close() exist in the Unix filesystem design?
Couldn't the OS just detect the first time read() or write() was called and do whatever open() would normally do?
|
Dennis Ritchie mentions in «The Evolution of the Unix Time-sharing System» that open and close along with read, write and creat were present in the system right from the start.
I guess a system without open and close wouldn't be inconceivable, however I believe it would complicate the design.
You generally want to ma... | On Unix systems, why do we have to explicitly `open()` and `close()` files to be able to `read()` or `write()` them? |
1,456,364,840,000 |
I'm trying to learn UNIX programming and came across a question regarding fork(). I understand that fork() creates an identical process of the currently running process, but where does it start? For example, if I have code
int main (int argc, char **argv)
{
int retval;
printf ("This is most definitely the pare... |
The new process will be created within the fork() call, and will start by returning from it just like the parent. The return value (which you stored in retval) from fork() will be:
0 in the child process
The PID of the child in the parent process
-1 in the parent if there was a failure (there is no child, naturally)
... | After fork(), where does the child begin its execution? |
1,456,364,840,000 |
I have read the man pages of Curl, but I can't understand what those parameters (k, i and X) mean. I see it used in a REST API call, but can someone please explain what those three parameters do? It's not clear in the documentation.
Thank you in advance.
|
-k, --insecure: If you are doing curl to a website which is using a self-signed SSL certificate then curl will give you an error as curl couldn't verify the certificate. In that case, you could use -k or --insecure flag to skip certificate validation.
Example:
[root@arif]$ curl --head https://xxx.xxx.xxx.xxx/login
... | What is the meaning of "curl -k -i -X" in Linux? |
1,456,364,840,000 |
I always assumed the st_blocks field returned by stat()/lstat()... system calls and which du uses to get the disk usage of files was expressed in 512 bytes units.
Checking the POSIX specification, I now see POSIX makes no guarantee for that. The perl documentation for its own stat() function also warns against making... |
st_blksize is called "the optimum I/O size" and unrelated to the units used for st_blocks. The optimum I/O size of course is filesystem specific. This is a result from the fast filesystem development from Berlekey in 1981/1982. Before, there was no optimum block size in the available filesystem
st_blocks is expressed ... | On what UNIX-like system / filesystem is the st_blocks field returned by stat() not a number of 512-byte units? |
1,456,364,840,000 |
It's possible to mount both Apple HFS+ and Microsoft NTFS filesystems under Linux.
Both filesystems support multiple content streams per file, though this is not widely used.
Apple uses the term fork.
Microsoft uses the term Alternate Data Stream.
Are there (semi) standard ways to access these filesystem features fr... |
ntfs-3g can read alternate data streams in NTFS. From its manpage:
Alternate Data Streams (ADS)
NTFS stores all data in streams. Every file has exactly one unnamed
data stream and can have many named data streams. The size of a file
is the size of its unnamed data stream. By default, ntfs-3g w... | Can I read and write to alternate HFS+ file forks or NTFS data streams from Linux? |
1,456,364,840,000 |
I was debugging a fuse filesystem that was reporting wrong sizes for du. It turned out that it was putting st_size / st_blksize [*] into st_blocks of the stat structure. The Linux manual page for stat(2) says:
struct stat {
…
off_t st_size; /* total size, in bytes */
blksize_t st_blksize; /* blocksi... |
st_blocks is defined as
Number of blocks allocated for this object.
The size of a block is implementation-specific. On Linux it’s always 512 bytes, for historical reasons; in particular, it used to be the typical size of a disk sector.
st_blksize is unrelated; it’s
A file system-specific preferred I/O block size
... | Why is st_blocks always reported in 512-byte blocks? |
1,456,364,840,000 |
There are two Linux kernel functions:
get_ds() and get_fs()
According to this article, I know ds is short for data segment.
However, I cannot guess what "fs" is short for.
Any explanations?
|
The FS comes from the additional segment register named FS on the 386 architecture (end of second paragraph).
My guess is that after DS for Data Segment and ES for Extra Segment Intel just went for the next characters in the alphabet (FS, GS). You can see the 386 register on the wiki page, on the graphic on the right... | What is "fs" short for in kernel function "get_fs()"? |
1,456,364,840,000 |
It was explained in this Stack Overflow thread that each logical terminal has a "pseudo-terminal", and that writing to one:
$ cat some-file.txt > /dev/ttys002
will cause the data to appear in that terminal window. What's the reason for providing a file-like API to terminal windows? Is there any use case where this is... |
Most hardware devices offer a file-like API. This is done because it makes both the design of the operating system and the design of applications simpler. The OS only has to have a file API and not a separate terminal API and a separate disk API and a separate sound API and so on. Applications that are not using featu... | Use case of providing file-like API to terminal/console |
1,456,364,840,000 |
Does FreeBSD support in any way the TWAIN API? If not, what is the API that could be used to read data from imaging devices (webcams) - preferably in a portable way.
|
The FOSS scanner/imaging API is SANE. You may need to install Linux compatibility files in order to allow it to access the webcam as a V4L device.
| TWAIN API support on FreeBSD |
1,456,364,840,000 |
I am spent whole half a day, but still couldn't figure, why is the dash being launched with execl call just becomes a zombie.
Below is a minimal test case — I'm just fork a child, make a duplicate of std [in,out,err] descriptors, and launch the sh.
#include <cstdio>
#include <fcntl.h>
#include <cstring>
#include <stdl... |
You're leaving a zombie, trivially, because you didn't wait on your child process.
Your shell is immediately exiting because you've set up its STDIN in a nonsensical way. pipe returns a one-way communications channel. You write to pipefd[1] and read it back from pipefd[0]. You did a buch of dup2 calls which lead the s... | The «sh» being launched with execl() becomes a zombie |
1,456,364,840,000 |
I reversed statements in if/else, corrected now.
I am reading a code snippet from Advanced Programming in the UNIX® Environment:
The program tests its standard input to see whether it is capable of seeking.
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(void){
if(lseek(STDIN_FILENO,0, ... |
//1 ./a.out:
If you do no redirection of stdin (no pipe and no <), stdin is inherited from the parent process. As you run a.out interactively in a shell, it inherits the terminal device that gets your keyboard input as stdin.
Terminal devices aren't usually seekable because they represent user interaction, but accordi... | Problems when test whether standard input is capable of seeking |
1,456,364,840,000 |
Is there any API that can be used to manipulate Linux routing table? I want to write a program that listens to sockets and then modifies routing table accordingly, just a simple code, but need an API.
|
You can use Netlink. From the wiki,
Netlink was designed for and is used to transfer miscellaneous
networking information between the Linux kernel space and user space
processes. Networking utilities such as iproute2 use Netlink to
communicate with the Linux kernel from user space. Netlink consists of
a stand... | API for IPROUTE2 in any programming language |
1,456,364,840,000 |
We are experiencing a weird issue on our servers. (Debian 8.9) We have an API which is a PHP application. It requests an elasticsearch which instance is on a separate server.
Every 2 hours, we are experiencing errors 500, it lasts during 1 or 2 minutes, rarely more:
[2017-10-19 20:52:10] +2 hours
[2017-10-19 22:51:59]... |
They finally managed to find the issue. And the root cause is totally stupid. If fact a monitoring view of the es cluster sent a lot of queries to es. About 6 times more than the application itself!
As you can see every 2 hours the memory was too high and the server was unavailable several minutes until it clears the... | Timeouts between an API and an elasticsearch server every 2 hours |
1,456,364,840,000 |
I am trying to extract some info about github repositories using its API, apparently jq is the way to go.
I can use this command to view all the available info:
curl 'https://api.github.com/repos/tmux-plugins/tpm' | jq
Output:
{
"id": 19935788,
"node_id": "MDEwOlJlcG9zaXRvcnkxOTkzNTc4OA==",
"name": "tpm",
"fu... |
In all cases below, file.json is the name of a file containing your JSON document. You could obviously use jq as you've done in the question instead, and have it read from a pipe connected to the output of curl.
Pulling the requested fields out, one by one:
$ jq -r '.description' file.json
Tmux Plugin Manager
$ jq -... | how to extract fields of info from github api using jq |
1,456,364,840,000 |
I've currently got code that forks two processes. The first reads a http streaming radio and pushes the data down a pipe (opened with pipe() ) for the second process to read, decode and output to the sound card using OSS.
I've been trying to debug the decoding part (separate issue) and I've come across a situation whe... |
A new file descriptor always occupies the lowest integer not already in use.
$ cat >test.c
main(){exit(open("/dev/null",0));}
^D
$ cc test.c
$ ./a.out; echo $?
3
$ ./a.out <&-; echo $?
0
$ ./a.out >&-; echo $?
1
The system doesn't care about "standard file descriptors" or anything like that. If file descriptor 0 is... | stop pipe() opening stdin |
1,456,364,840,000 |
What is the best way to retrieve the current time zones of a number of countries, on a daily basis? (that would take into account DST changes, of course)
Reliably
If possible the Linux way (i.e. either using internal resources, or a Linux website API)
(I'm on Ubuntu 10.04)
|
If you just want the timezone, then timezones are stored in /usr/share/zoneinfo.
If you want to be able to retrieve the current time for a number of different cities or countries, then you can pull them from the Date and Time Gateway.
| Retrieve countries timezones |
1,456,364,840,000 |
#include <linux/io_uring.h>
main.c:1:10: fatal error: linux/io_uring.h: No such file or directory
#include <linux/io_uring.h>
^~~~~~~~~~~~~~~~~~
Kernel version 5.4.0-80.
I have not found a way to install the API header files. The ABI should be supported though.
|
On Ubuntu (which I’m guessing is what you’re using, based on the kernel version), you’ll find linux/io_uring.h in linux-libc-dev. Install that:
sudo apt install linux-libc-dev
and you should find the header in /usr/include/linux.
Programs written using liburing use that library’s headers, so installing that is unlike... | Missing header file linux/io_uring.h |
1,456,364,840,000 |
How and where does this Gnome applet get weather information? Same question for sunrise and sunset times.
I suppose there is a web API it queries but which one and can I use it?
(sorry for the screenshot in french)
|
gnome-weather uses libgweather underneath which in turn uses several GWeatherProviders (defined in gweather-weather.h) to get weather information for your particular geo-location:
* GWeatherProvider:
....
* @GWEATHER_PROVIDER_METAR: METAR office, providing current conditions worldwide
* @GWEATHER_PROVIDER_IWIN: ... | How does Gnome clock/calendar applet get weather, sunset and sunrise time information? |
1,456,364,840,000 |
I'm using the Ansible module for Bluecat to make an authorized API call to get some information about a subnet. The response looks something like this:
"result": {
"changed": false,
"failed": false,
"json": "b'{\"id\":12345,\"name\":\"SUBNET NAME\",\"properties\":\"CIDR=10.2.2.0/24|allowDuplica... |
Strip what's outside the braces {} and Ansible will parse the dictionary
subnet: "{{ result.json[2:-3] }}"
gives
subnet:
id: 12345
name: SUBNET NAME
properties: CIDR=10.2.2.0/24|allowDuplicateHost=enable|pingBeforeAssign=disable|inheritAllowDuplicateHost=true|inheritPingBeforeAssign=true|gateway=10.2.... | How to parse an escaped json string with ansible/jmespath/jq? |
1,456,364,840,000 |
What specifically needs to be changed in the below in order for a program running on an Ubuntu-latest GitHub runner to successfully connect to a Twisted web server running on localhost of the same GitHub runner?
The same code works on a Windows laptop, with only minor changes like using where twistd on Windows versus ... |
Regarding:
The curl command fails to connect to the correctly-stated http://localhost:1234/api/endpoint/
The main problem here is that every command you run with runShellCommand("somecommand") is executed in a new shell so all changes such as functions,variables, environment variables, etc. disappear after the comma... | Ubuntu-latest GitHub runner cannot Connect to localhost API |
1,456,364,840,000 |
For process_vm_readv the linux man page states:
[...] (Avoid) spanning memory pages (typically 4KiB) in a single remote iovec element. (Instead, split the remote read into two remote_iov elements and have them merge back into a single write local_iov entry. The first read entry goes up to the page boundary, while the... |
You should really read the whole paragraph -- that way of splitting the iovecs is not a hard requirement. It's only supposed to help in the case of a partial read, though it's not clear how it could help ;-)
That manpage is quite dubious and confusing; my testing shows that process_vm_readv() will always error out if ... | Read arbitrary amount of memory with process_vm_readv |
1,456,364,840,000 |
Many fields in structs defined by the Unix API have prefixes, like sa_ in sa_handler defined in struct sigaction. Why is it so? Why isn't sa_handler called just handler?
|
This goes back a long way, all the way to the first C versions. They didn't have a seperate symbol table for structure members, the names were added to the global symbol table. With the obvious nasty global namespace pollution that causes. The workaround was the same one you use on enums today, prefix them with a cou... | Why fields in structs defined by the Unix API have prefixes? |
1,456,364,840,000 |
Why isn't there the Unix API? I mean, as there is the Windows API.
I know a lot of things in the Unix world is modular, and those things put together creates a whole system. This sounds good but does create some problems when you try to make a native Unix app.
For example, you want to program a nice word processor wi... |
It really seems to me that the Unix community is killing themselves in the Desktop world.
I think there is a misconception that any form of Unix exists in order to compete in the home PC market. There are some linux distros which have this focus; the first one was really Ubuntu, but it is worth considering that par... | Why isn't there a Unix API? [closed] |
1,456,364,840,000 |
From https://unix.stackexchange.com/a/436631/674
the file /proc/$$/environ ... does not reflect any changes to the environment, but just reports what the program received when it was execed by the process.
From APUE:
Each program is also passed an environment list. Like the
argument list, the environmen... |
/proc/$$/environ and the variable environ are independent. environ does reflect changes to the environment, and in fact the value of the pointer in environ also changes when environment variables are added to the environment via putenv() (but this is an implementation detail.)
We'll have to distinguish between the sys... | Do the strings accessible via global variable `environ` not reflect any change to the environment? |
1,456,364,840,000 |
I have a some internally available servers (all Debian), that share a LetsEncrypt wildcard certificate (*.local.example.com). One server (Server1) keeps the certificate up-to-date and now I'm looking for a process to automatically distribute the .pem-files from Server1 to the other servers (e.g. Server2 and Server3).
... |
I've settled on an rsync-only user, that can only rsync data to a predefined directory using ssh-keys (https://gist.github.com/jyap808/8700714). I rsync the files with script that runs after successful letsencrypt deployments. On the receiving servers, I have an inotifywait service running that moves the files to the ... | How to distribute HTTPS certificate/key securely and automatically on internal servers |
1,456,364,840,000 |
We are developing embedded device which will integrate with some of our services in future. This device have limited set of functionalities and user defined mods for particular use cases. Based on arm architecture this device running modified version of Debian. For network and main configuration setup I need to write... |
Although this question is a little vague and open to opinion I'll throw mine out there. Golang Has a very easy to use server package right in the standard library. It looks a lot like C, compiles to native executables on almost any platform and architecture and you can host a very simple webserver with very few lines ... | writing small web service for embedded device based on debian [closed] |
1,393,182,323,000 |
I want to run a command on Linux in a way that it cannot create or open any files to write. It should still be able to read files as normal (so an empty chroot is not an option), and still be able to write to files already open (especially stdout).
Bonus points if writing files to certain directories (i.e. the current... |
It seems that the right tool for this job is fseccomp Based on sync-ignoringf code by Bastian Blank, I came up with this relatively small file that causes all its children to not be able to open a file for writing:
/*
* Copyright (C) 2013 Joachim Breitner <[email protected]>
*
* Based on code Copyright (C) 2013 Bas... | How to prevent a process from writing files |
1,393,182,323,000 |
I'm logged in remotely over SSH with X forwarding to a machine running Ubuntu 10.04 (lucid). Most X11 applications (e.g. xterm, gnome-terminal) work fine. But Evince does not start. It seems unable to read ~/.Xauthority, even though the file exists, and is evidently readable (it has the right permissions and other app... |
TL,DR: it's Apparmor's fault, and due to my home directory being outside /home.
Under a default installation of Ubuntu 10.04, the apparmor package is pulled in as an indirect Recommends-level dependency of the ubuntu-standard package. The system logs (/var/log/syslog) show that Apparmor is rejecting Evince's attempt t... | Evince fails to start because it cannot read .Xauthority |
1,393,182,323,000 |
I am just testing out a new Ubuntu (Vivid 15.04) install on Vagrant, and getting problems with mysql and logging to a custom location.
In /var/log/syslog I get
/usr/bin/mysqld_safe: cannot create /var/log/mysqld.log: Permission denied
If I ls -l /var I get
drwxrwxr-x 10 root syslog 4096 Jun 8 19:52 log
If I look in... |
It seems to me that most people create a directory named mysql inside of /var/log, change the owner of this folder to the mysql user.
sudo mkdir /var/log/mysql
sudo chown mysql:mysql /var/log/mysql
That should do it. Be sure to update the server's logging location and restart it. After you've tested re-enable mysq... | Permission denied writing to mysql log |
1,393,182,323,000 |
I have a Docker container (LXC) which runs MySQL. Since the idea behind Docker is generally "one running process per container," if I define AppArmor profiles targeting the MySQL binary, will they be enforced? Is there a way for me to test for this?
|
First, cgroups are not used to isolate an application from others on a system. They are used to manage resource usage and device access. It's the various namespaces (PID, UTS, mount, user...) that provide some (limited) isolation.
Moreover, a process launched inside a Docker container will probably not be able to mana... | AppArmor profiles in Docker/LXC |
1,393,182,323,000 |
I have my "root" partition split into two: a normal one that contains most files and a second one used for those areas that can "grow". Concretely, this means, I have symlinks like:
/var/log -> /part1/log
/var/cache -> /part1/cache
/var/spool -> /part1/spool
This worked well until I started using AppArmor which ke... |
It can be done in /etc/apparmor.d/tunables/alias as follows:
# Alias rules can be used to rewrite paths and are done after variable
# resolution. For example, if '/usr' is on removable media:
# alias /usr/ -> /mnt/usr/,
#
# Or if mysql databases are stored in /home:
# alias /var/lib/mysql/ -> /home/mysql/,
/var/log ... | How to teach AppArmor about toplevel symlinks |
1,393,182,323,000 |
If I tell applications like VLC or Audacity to record from my webcam or microphone, they just wake the hardware if sleeping and do their work without my interference.
Although this is a good thing, I've always wondered, due to privacy concerns: is there a way to restrict applications access to a hardware device?
While... |
I guess the traditional way would be to make pseudo-users (like the games-user) for the program/set of programs, assign this user to the groups for devices it should access (eg. camera), and run the program(s) SUID as this user. If you removed permissions for "others" (not owner or group), only the owner and members ... | Restrict applications to access certain hardware (webcam, microphone...) |
1,393,182,323,000 |
Can anyone explain this line in the log.smbd? Searching the internet for apparmor details gets so many hits I cannot find the information. This occurs when smbd is started.
kernel: [908896.070790] type=1400 audit(1442305563.416:371): apparmor="STATUS"
operation="profile_replace" profile="unconfined" name="/usr/sbin... |
I would beg to differ with Marks answer.
Any time I type sudo service mysql restart I see a similar message in syslog... time kernel:
audit: type=1400 apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/mysqld" pid=5014 comm="apparmor_parser"
If I then type sudo aa-status I see that m... | what is apparmor "profile_replace" log message |
1,393,182,323,000 |
Is there a way to create an AppArmor profile for each Firefox profile, when running multiple profiles off a single installation of Firefox? Or more generally for any application supporting multiple profiles, Thunderbird, etc. Generally all the AppArmor profiles I find for these apps only contain the whole app, unless ... |
AppArmor works by executable. It can't figure out that Firefox has loaded a different profile and so it should use a different AppArmor profile.
AppArmor does support change rules, which allow an application to change which profile applies to it. The intended use case is precisely to allow an application to switch to ... | AppArmor: Are multiple profiles per application (Firefox, Thunderbird) possible? Syntax? |
1,393,182,323,000 |
In researching this U&L Q&A titled: permission denied for ptrace under GDB, the question came up, "Is there other software similar to SELinux & AppArmor?".
User @IwillnotexistIdonotexist mentioned 2 that I'd never heard of: Smack & Yama. He found them by searching through the Linux source code. So now we're up to 4.
... |
In searching for Linux Security Modules, I came across the wikipedia page, titled: Linux Security Modules.
These are the following LSM's listed there:
SELinux
AppArmor
Smack
TOMOYO Linux
YAMA LSM
Linux Intrusion Detection System
FireFlier
CIPSO
Multi ADM
Of the modules listed, the first 4, SELinux, AppArmor, Smack, ... | Are there other LSM (Linux Security Modules) in addition to SELinux and AppArmor? |
1,393,182,323,000 |
I am running Ubuntu 16.04 with apparmor 2.10.95-0ubuntu2.7. I often need to comment on software of dubious quality. I want to employ apparmor to guard my system from harm.
I created an apparmor wildcard profile like this:
/home/username/testing/** {
somerules
}
Unfortunately, this profile has no effect. It works as... |
Tinkering around with this problem today, I found the wildcard profile working as expected after a reboot. It looks like setting the profile to enforce mode with aa-enforce /etc/apparmor.d/<profile> or reloading the profile with apparmor_parser -r /etc/apparmor.d/<profile> as described here and here is not sufficient ... | apparmor wildcard profile with globbing |
1,393,182,323,000 |
Environment:
OS: Debian GNU/Linux 9.3 (stretch)
Kernel parameter: security=apparmor
Here is my test profile (created by aa-genprof):
/etc/apparmor.d/usr.bin.telnet.netkit
#include <tunables/global>
/usr/bin/telnet.netkit {
#include <abstractions/base>
/lib/x86_64-linux-gnu/ld-*.so mr,
/usr/bin/telnet.netkit m... |
If I'm reading correctly you are running debian.
Well the problem is that the kernel in debian lacks of the needed code to block the network connections (same for D-Bus mitigation) as the patches are not mainline (yet, I know there was work to change the situation).
| How to deny application's access to network by AppArmor? |
1,393,182,323,000 |
I've installed and enabled snappy on my openSUSE Leap 15.1 system according to this documentation: https://snapcraft.io/docs/installing-snap-on-opensuse
When adding the repository, I used the one for my specific version: https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.1/
However, after enabl... |
Never mind, found it (I think). Apparently the service only keeps running when there are any snaps installed. Since I hadn't installed any snaps yet, it terminated itself after starting. After installing the first snap, snapd kept running in the background.
In order to install, first you have to stop the daemon:
syste... | snapd fails on openSUSE Leap 15.1 |
1,393,182,323,000 |
Under my new Linux Mint 18.3 (64 bit) installation on my notebook, the command
$ sudo apparmor_status
returns the following:
apparmor module is loaded.
apparmor filesystem is not mounted.
Is AppArmor configured for usage under Linux Mint or do I have to enable and configure it first? Because, as you can see, the com... |
To enable apparmor you need to boot your system with apparmor=1 security=apparmor option.
Edit your /etc/default/grub by modifying the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
To:
GRUB_CMDLINE_LINUX_DEFAULT="apparmor=1 security=apparmor quiet"
Then update grub and reboot:
sudo update-grub
sudo reboot
Debian : Enabl... | Is AppArmor actively used by Linux Mint 18? |
1,393,182,323,000 |
I installed bind9 with chroot on Debian11, described by this tutorial: https://wiki.debian.org/Bind9#Debian_Jessie_and_later
It works fine, but as soon as I turn on dynamic zone updates, it will fail with this reason in the syslog:
Jul 18 19:22:52 NS kernel: [12161.968582] audit: type=1400 audit(1658164972.109:107): a... |
The log message (wrapped for readability)
Jul 18 19:22:52 NS kernel: [12161.968582] audit: type=1400 audit(1658164972.109:107): \
apparmor="DENIED" operation="open" profile="named" name="/var/bind9/chroot/" pid=18104 \
comm="named" requested_mask="r" denied_mask="r" fsuid=106 ouid=0
indicates the named proces... | Bind9 dynamic zone updates are denied by apparmor in Debian11 |
1,393,182,323,000 |
I've compiled a kernel (linux-libre-xtreme) with this configuration, it has most LSMs enabled: YAMA, SMACK, AppArmor, TOMOYO and SELinux. However, when I start the apparmor service with OpenRC I get:
# rc-service apparmor start
* Stopping AppArmor ...
* Unloading AppArmor profiles
* Root privileges not availabl... |
Solved by disabling CONFIG_DEFAULT_SECURITY_DAC=y, there has to be only one CONFIG_DEFAULT_SECURITY_* enabled it seems
EDIT: I also discovered that, for AppArmor to be enabled by default when booting, SECURITY_APPARMOR_BOOTPARAM_VALUE must be set to "1", like this: CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
| Enabling AppArmor in Linux |
1,393,182,323,000 |
I realise this is probably a bad question but I'm stuck. After a lot of googling I'm struggling to fix the problem. I've been trying to get AppArmor to work on Debian. I've been following the instructions from https://wiki.debian.org/AppArmor/HowToUse.
Part of the instruction told me to do
sudo perl -pi -e 's,GRUB_CM... |
I have managed to solve the issue. The way I did this was by editing /etc/default/grub and changing GRUB_CMDLINE_LINUX from
GRUB_CMDLINE_LINUX=" apparmor=1 security=apparmor"
to
GRUB_CMDLINE_LINUX=""
Then after running sudo update grub and sudo reboot the issue was fixed. However this stopped apparmor from working a... | AppArmor is causing Firefox segfaults |
1,355,584,342,000 |
I am going through some primers on LSM implementations so eventually I am digging a bit into AppArmor and SELinux.
I am aware of this discussion but this does not make very clear one question I am having in regard to these two LSM implementations:
Is it a fact that:
SELinux must be applied system-wide (thus the auto-... |
As I answered to the other question, a major difference between AppArmor and SELinux is labeling. AppArmor is path based while SELinux adds additional label to every object. This is why auto relabeling is done at first boot to apply the default file labels. Otherwise it would not be possible to write meaningful policy... | SELinux vs AppArmor applicability |
1,355,584,342,000 |
We have a few workstations that have access to a network share with all our company files. This is correct, because users may need to use them.
However our boss is concerned that someone (upon resignation maybe) may plug in a USB drive and take those files home or things like that. Since we can't forbid USB drives (we... |
No, you can't. If they can read the files they can copy them.
EDIT:
I've been thinking about it and maybe you can do something. If those files should only be accessed by a couple of programs (You said something about CAD files) maybe you can set the program owner to a new user (let's say CADuser) and change the permis... | How to protect against data leak? |
1,355,584,342,000 |
I have a file with a secret and a generator application that reads it and generates something similar to a license.
There are users on that Linux machine who are allow to use that application.
Because that app read that secret file, these users must have read permission to that file.
Is there a way to remove the read ... |
Use getuid() instead of geteuid().
From the execve() man page:
If the set-user-ID bit is set on the program file referred to by
pathname, then the effective user ID of the calling process is
changed to that of the owner of the program file.
The "real" user ID, which getuid() returns is unchanged, that is, it's the U... | Allow file read only through application |
1,355,584,342,000 |
I have a ubuntu 20.04 server running docker. Recently the default apparmor profile seems to have started enforcing a restriction on mount points in docker containers. So the containers write directly to the root filesystem rather than the mount.
Outside of docker I can navigate the mounts with no issues but when execu... |
So it turns out my issue was actually with Docker starting before filesystems were mounted. I believe I can alter the systemd file for docker to delay starting until my mounts are in place. The containers were binding to the mount point as a directory and writing directly to the root filesystem.
Incidentally you can c... | How do I enable mounting filesystems in docker containers using apparmor |
1,355,584,342,000 |
firejail --net=none creates a sandbox looking like a computer without any network interfaces.
Is it possible to achieve the same result with AppArmor? It looks like, AppArmor's deny network just denies everything, but doesn't hide the network interfaces from the application.
|
The reason firejail makes the network interfaces "disappear" is that it runs the application in a new network namespace:
DESCRIPTION
Network namespaces provide isolation of the system resources
associated with networking: network devices, IPv4 and IPv6 protocol
stacks, IP routing tables, firewall rules, the /proc/net... | AppArmor equivalent to Firejail --net=none |
1,355,584,342,000 |
As far as I know, AppArmor cannot grant privileges to a program that otherwise doesn't have it (i.e. it can only further restrict). Given that, would it be okay to "allow all" for all programs at first, and iteratively add more rules & fine-tune the existing ones?
People seem to disagree with that on the Web it seems,... |
Sure it would be technically possible... but it's not the most efficient way to work.
If you first allow everything, you'll need to keep guessing what things would be good to disallow. You'll be effectively working blind.
If you first disallow everything, you'll get program error messages, giving you information about... | Is iteratively adding more AppArmor rules bad? |
1,355,584,342,000 |
I accidentally deleted the /etc/apparmor/ folder on my debian 4.19.28-2 box by having the wrong folder selected in a gui file browser.
My questions are:
Should I be worried?
#apparmor_status
apparmor module is loaded.
Is there a way to find what should have been in that folder? Perhaps a way to search apt for all... |
You can try to reinstall it with
apt-get install --reinstall apparmor
| I've accidentily deleted /etc/apparmor/, what should I do to restore it? |
1,355,584,342,000 |
I know that using apparmor, one can reduce process capabilities(7). But is it possible to gain them?
For example: ping requires CAP_NET_RAW. It's binary has no suid set and doesn't have any file capabilities. Is it possible to give CAP_NET_RAW to it, without touching binary itself? (eg. with creating apparmor rule)
Gr... |
No, it's not possible.
AppArmor works in addition to the standard Linux permission checks, not instead of. It can't grant any privilege the program didn't already have.
| Using apprarmor/grsec to gain capabilities for file |
1,355,584,342,000 |
I don't really know how to add this rule to the profile, since the name was "wired", it's not some absolute path on my system,
kernel: type=1400 audit(1353749970.556:556): apparmor="ALLOWED"
operation="open" parent=1
profile="/usr/lib/firefox/firefox{,*[^s][^h]}"
name=2F4170706C69636174696F6E2F7468656D65732F4C6... |
The string is encoded because it contains special chars,
Decoded the string with aa-decode 2F4170706C69636174696F6E2F7468656D65732F4C696F6E2D7468656D652D72656C6F61646564202F67746B2D322E302F67746B7263 and found out the issue was caused by a newly introduced GTK theme.
Now it's fixed, just simple add a line to that prof... | Fix this apparmor rule? |
1,355,584,342,000 |
I want to run some analytics on my mail.log (postfix 3.2.13 on Ubuntu 20.04 LTS) including updating a db of undeliverable emails, so I wrote script, excluded mail.log from the generic /var/log logrotate script and created a new /etc/lorotate.d/mail_log which ran the script in the post-rotate section. Although the scri... |
This is probably caused by systemd’s protection features, which are enabled for logrotate and Postfix. In particular, ProtectSystem, if set to “full” or “strict”, will result in /etc being read-only.
You should move anything you want to be able to modify to var, or if you can’t avoid changing /etc, override the releva... | Postfix thinks its on a read only filesystem? |
1,355,584,342,000 |
I have home server with proxmox 5 installed and some services in docker containers.
All was fine till yestarday.
I rebooted the server and all services in all containers cannot bind socket because of permission denied. I'm frustrated...
Here some technical details
Linux server 4.10.15-1-pve #1 SMP PVE 4.10.15-15 (Fri... |
I have added security_opt to docker-compose and problem has gone.
security_opt:
- apparmor:unconfined
But I do not consider this option a completely correct solution of the problem.
| docker socket: permission denied |
1,355,584,342,000 |
UPDATE: I now know my issue was database corruption, but discerning it was somewhat tricky--apparmor appeared to be the cause for longer than it should've.
I didn't note when first posting that even after putting mysql in complain mode and sending apparmor both stop and teardown commands my syslog still showed the app... |
Database corruption.
Occam's Razor prevails. I moved backups to a new server and updated the db location/apparmor config. I cringed as I restarted everything. I'd spent hours convincing myself AppArmor was a cavernously complex and difficult beast, but my reticence was completely without cause--it worked perfectly on ... | apparmor: mysql permissions--with no recent changes |
1,355,584,342,000 |
BIND9 denying queries from IPs outsite localnet (External IPs) on Ubuntu.
options {
listen-on port 53 { any; };
directory "/var/bind";
allow-query { any; };
allow-query-cache { any; };
allow-transfer { none; };
recursion ... |
This was an upstream loadbalancer issue - responses were being received by the wrong IP and being dropped by firewalls on the other end.
| BIND9 denying queries from IPs outsite localnet (External IPs) - Ubuntu 14.04 |
1,355,584,342,000 |
What are all the ways AppArmor profiles can be matched to processes? One seems to be path based (e.g. the /sbin/dhclient profile is applied when /sbin/dhclient is executed) but is this due to /sbin/dhclient appearing in the sbin.dhclient profile or because of the way sbin.dhclient is named?
Also, for non-path based pr... |
AppArmor profiles using a mangled path of the command for the filename is just a convention. From man 7 apparmor:
Profiles are traditionally stored in files in /etc/apparmor.d/ under
filenames with the convention of replacing the / in pathnames with .
(except for the root /) so profiles are easier to manage (e.g.... | How does AppArmor match profiles to processes? |
1,355,584,342,000 |
Context : I installed (manually) the apparmor-utils and apparmor-profiles and apparmor-utils, since when trying
apt-get install apparmor-utils apparmor-profiles
can't find the packages.
aa-status
works as usual.
I also did
sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="/&security=apparmor /' /etc/default/grub
to enable ... |
I think you are missing apparmor package which will provide that python module:
sudo apt install python3-apparmor
If you can’t install that, you need to fix your repository configuration; you will then also be able to install the Debian AppArmor packages.
| No module named apparmor. Why? |
1,355,584,342,000 |
I have Ubuntu 16.04 and lately I reinstalled AppArmor:
sudo rm -rf /etc/apparmor*
sudo apt-get install apparmor --reinstall
sudo service apparmor restart
When I am trying to parse a profile with apparmor_praser I got error:
AppArmor parser error for my.profile in my.profile at line 1:
Could not open 'tunables/... |
I went to this place:
https://launchpad.net/ubuntu/xenial/+source/apparmor
download:
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/apparmor/2.10.95-0ubuntu2.10/apparmor_2.10.95.orig.tar.gz
Inside this tar file I wend to ../profiles/apparmor.d and extracted all the content to /etc/apparmor.d by:
cp -r ... | Re-installation of AppArmor misses some files |
1,355,584,342,000 |
Every time I run virsh destroy ${KVM} as root I get the following error (virsh shutdown ${KVM} is showing absolutely no reaction, nothing happens):
error: Failed to destroy domain ${KVM}
error: Failed to terminate process 11956 with SIGTERM: Permission denied
When I run shutdown -h now inside the KVM, it hangs foreve... |
Setting security_driver = "none" will not disable apparmor in the kernel, just some support in libvirt itself
Looking at the apparmor profile in current stable (debian 9/stretch) and the one currently in unstable, I see quite some differences.
I believe you could add the following rule in /etc/apparmor.d/local/usr.sbi... | KVM: Can not destroy VM (Permission denied) - AppArmor blocking Libvirt |
1,509,513,280,000 |
I just installed Debian 9.2.1 on an old laptop as a cheap server. The computer is not physically accessed by anyone other than myself, so I would like to automatically login upon startup so that if I have to use the laptop itself rather than SSH, I don't have to bother logging in. I have no graphical environments inst... |
Edit your /etc/systemd/logind.conf , change #NAutoVTs=6 to NAutoVTs=1
Create a /etc/systemd/system/[email protected]/override.conf through ;
systemctl edit getty@tty1
Paste the following lines
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear %I 38400 linux
enable the [email protected] then reb... | Automatically Login on Debian 9.2.1 Command Line |
1,509,513,280,000 |
I have started running Jessie (Debian 8) with a LightDM/Xfce desktop on my HTPC after it grinding to a near-halt on W7. One of the things that I cannot get past is having to type the password -- not a normal thing to do for watching TV.
Following the instructions on the Debian Wiki I got as far as my login being autom... |
I solved it using the Debian wiki page and this page on LinuxServe -- especially the comment!
when I do /usr/sbin/lightdm --show-config I get two files: /etc/lightdm/lightdm.conf and /usr/share/lightdm/lightdm.conf.d/01_debian.conf
These I edited so that in /usr/share/lightdm/lightdm.conf.d/01_debian.conf it says:
gre... | auto login on xfce in jessie |
1,509,513,280,000 |
How do I open Fedora 19 without a user password?
My user name is mz2, and I want to login without a password.
|
According to the passwd man page:
-d This is a quick way to delete a password for an account. It will
set the named account passwordless. Available to root only.
so you can do this (as root):
passwd -d mz2
then you can login without a password
| How to open Fedora without a user password? |
1,509,513,280,000 |
How to autologin a specified user with xdm?
I know it's possible with other display managers but I wasn't able to figure out how xdm has to be configured to autologin a certain user.
Is it possible? Or should I rather remove xdm and simply use an initscript with startx?
|
I haven't used xdm in a long while but as far as I know autologin is not supported by xdm (and, as per one of the devs, not needed).
| How to autologin with XDM? |
1,509,513,280,000 |
A computer is being used for shift work currently with a shared account with autologin at boot. Certain UI applications start up at autologin and its important that they run continuously.
How can we securely authenticate individual users into this system (such as with smartcard) without ever logging out? The individ... |
You could try to implement smartcard-based authentication with PAM and map the smartcard certificate subject-DNs of all authorized users to this generic local login.
Newer versions of sssd have smartcard support. Not sure how mature it is though.
| Multiple user authentications for same account/environment |
1,509,513,280,000 |
When I'm supplying username and password to telnet to login, it is automatically closed after the following command:
echo password | telnet mymachine -l mysuername
The console outputs:
Connected to mymachine.
Connection closed by foreign host.
Then the connection is closed. Is there a way to maintain the connection ... |
If you want to continue with an interactive session, the usual way is to use expect to do the login:
#!/usr/bin/expect
spawn telnet mymachine -l myusername
expect Password:
send password\r
expect -- {$ }
interact
| NOT close telnet when supplying username and password using echo |
1,509,513,280,000 |
I switched from bash to fish shell. I liked it and decided to use it on my servers also. How can I start tmux automatically on ssh connection? I followed this instruction for bash but fish shell is different and this recipe doesn't work without cardinal rewriting.
|
Byobu, a terminal multiplexer, based on tmux, offers an autostart feature.
| How can I start tmux automatically in fish shell while connecting to remote server via ssh |
1,509,513,280,000 |
I have a headless computer (TS-7680) with Debian Jessie that I access via Putty command line. The computer does not have any GUI and is only accessed by the command line. It will be put into the field with a program that needs to restart automatically if there is a temporary power outage.
I know how to get the progr... |
Assuming systemd treats ttyAMA0 as a serial port the same way it would treat ttyS0 on a PC, you need to edit the command started by the [email protected].
(You could check if systemctl status serial-getty@ttyAMA0 shows it is active.)
The base version is in /lib/systemd/system/[email protected] and inside it we find th... | How do you configure autologin in Debian Jessie? |
1,509,513,280,000 |
Can someone help to autologin in console text mode as root in fedora, usually I can do using script like this :
/sbin/autologin.sh:
#!/bin/bash
0</dev/$1 1>/dev/$1 2>&1
cat /etc/issue
shift
exec $*
and on /etc/inittab do login by calling that script
1:2345:respawn:/sbin/autologin.sh tty1 login -f root
..
..
now I ca... |
Add the following line to "/etc/init/tty.conf":
exec /sbin/mingetty --autologin root $TTY
| autologin console as root on fedora |
1,509,513,280,000 |
I'm working with Linux (Fedora) without a GUI (I've disabled it). In the system, there is one user (tarik). I would like to log in automatically without typing the username and password. I have already deleted the password using the command:
passwd -d tarik
However, I don't know how to automatically log in to the u... |
Under Fedora, I'll presume you use systemd as init system and that the console you want to log from is a virtual console (tty[N]), that is to say not a serial console. Additionally assuming that agetty is running at startup. :
What you need is to override the default parameters given to agetty. You will need to define... | Login to Linux automatically without input username and password |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.