41 votes
Accepted

Is logging in as a shared user a bad habit?

Yes it is a bad habit. It relies on the basic assumption that nobody malicious is (or will be) around and that nobody makes mistakes. Having a shared account makes it trivial for things to happen ...
thkala's user avatar
  • 1,220
33 votes

Creating a windows account only for share access

As the reply of joeqwerty is not clear, I want to put the steps in line. This works for Windows 7, 8, and 10 (I'm on 10), as well as Windows Server 2003, 2008, and 2012. Create the user (if you don't ...
DefToneR's user avatar
  • 537
27 votes
Accepted

Crate a new, read-only user in postgres

Reference taken from this Article ! Script to Create Read-Only user: CREATE ROLE Read_Only_User WITH LOGIN PASSWORD 'Test1234' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL '...
Anvesh's user avatar
  • 684
11 votes

GRANT SELECT to all tables in postgresql

I ended up doing this, and it worked: ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO PUBLIC;
szeitlin's user avatar
  • 211
11 votes
Accepted

Centos 7 - adding a user to sudoers group - still is not in the sudoers file - why?

My experience is that 'user' needs to log out and in again. Try the 'id' command to see if the system thinks that 'user' is in the wheel group or not.
Ed Greenberg's user avatar
11 votes

How to create extra root user?

Premise: using sudo (as suggested by the accepted answer) probably is the correct solution at your problem. That said, if you really need something resembling a second root account, you can create an ...
shodanshok's user avatar
  • 50.7k
10 votes

systemd, per-user cpu and/or memory limits

Starting with systemd v239, you can use drop-ins https://github.com/systemd/systemd/commit/5396624506e155c4bc10c0ee65b939600860ab67 # mkdir -p /etc/systemd/system/user-.slice.d # cat > /etc/...
ValdikSS's user avatar
  • 331
8 votes

Easy way to get all user accounts

How to list all users and groups depends on how authentication is configured. The most basic are the /etc/passwd and /etc/group files used for local authentication. Using those files is ...
HBruijn's user avatar
  • 80.3k
7 votes

useradd with 755 permissions

I know its a quite old post, however: useradd -K UMASK=0077
blakksnail's user avatar
7 votes

How does google compute engine create users and how to disable them?

As of March 2017 you can prevent the accounts from being created by disabling the Accounts daemon, that is deployed on all images in GCE. To do that: Create /etc/default/instance_configs.cfg....
Greg Dubicki's user avatar
  • 1,341
7 votes
Accepted

Is there some way a user with an asterisk as password in /etc/shadow but a correct login shell in /etc/passwd would be able to login via SSH?

A * in the location of the hashed password in /etc/shadow effectively disables all password based logins as no user input will ever result in a hash value of *. But the user can still login with his/...
HBruijn's user avatar
  • 80.3k
7 votes
Accepted

pg_hba.conf - psql local login without password

local all all md5 local all postgres trust # ident Remember that the entries in pg_hba are processed in the order they given. "local all postgres trust" ... should ...
Phill  W.'s user avatar
  • 1,511
6 votes

Is logging in as a shared user a bad habit?

To start with this doesn't shock me, and I work in an extremely secured environment. Everyone has his own user and machine and ssh key, and for working on a server we ssh in, as root or as another ...
Law29's user avatar
  • 3,577
6 votes

Is using the AD home directory attribute to map the home drive really no longer a best practice?

The HomeDrive attribute is not deprecated and will probably not ever be removed. The reason it's popular is because it was the first attribute that removed the requirement of using logon scripts to ...
spacenomyous's user avatar
  • 1,339
6 votes

GRANT SELECT to all tables in postgresql

I ended up here because my DB user saw only a few tables and not the newer ones. If this is your case, this has helped me. Grant privileges to all existing tables: GRANT SELECT ON ALL TABLES IN ...
CraZ's user avatar
  • 218
6 votes

Unable to get the SSH access for a new user

On Ubuntu 18.04 I had simply neglected to add my client's public key to the authorized keys file (this post got me thinking about the authorized_keys file: https://superuser.com/a/1337741/413936). ...
jbobbins's user avatar
  • 165
6 votes

What is the minimum annual overhead required to admin an On-Premises Exchange Server

A data point. I manage about 24 Exchange servers for customers now, and spend about 2 hours per month on mail-related issues which may include SSL certificates, user management, managing the ...
ewwhite's user avatar
  • 198k
6 votes

Removing install user with Packer

I found another way that works with packer 1.7 for QEMU, VMware, and VirtualBox. You can remove the user in the shutdown command. This method assumes the user has sudo access. shutdown_command = &...
nibty's user avatar
  • 161
6 votes
Accepted

systemd, per-user cpu and/or memory limits

UPD: I'll keep my solution for the sake of history, but systemctl set-property should be called at login time, using pam_exec, see https://github.com/hashbang/shell-etc/pull/183. In this approach, ...
intelfx's user avatar
  • 311
6 votes
Accepted

How to su non-interactively?

You could either use the echo : echo <otherpwd> | su - otheruser -c "my command line" or expect: expect -c 'spawn su - otheruser -c "my command line"; expect "Password :"; send "<otherpwd&...
tonioc's user avatar
  • 1,065
6 votes

Setting a Windows Non-Interactive User Account

With a Group Policy. Go to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment and put your user account into the "Deny log on Locally" and "...
Massimo's user avatar
  • 71.3k
5 votes

Unable to get the SSH access for a new user

Stumble to this thread after create a new user and cannot SSH to the new user. I managed to fix it after looked for the group and user of .ssh folder and authorized_keys file. They were set to root:...
Wild Teddy's user avatar
5 votes

What's the best way to see logged in users in Windows Server 2012?

"quser" command will give you the active now users the same result will give you the "qwinsta" command
Hristo Maznev's user avatar
5 votes

Removing install user with Packer

I realize this is a rather old question, but I didn't like the idea of using a cronjob (or cloud-init, or anything that happens after the image would be instantiated) for this, and found what I find ...
Joey Coleman's user avatar
5 votes
Accepted

How to create extra root user?

You can't. root is a special user with uid 0. Use sudo instead.
Sven's user avatar
  • 99.6k
5 votes
Accepted

What are my options in terms of controlling document management

It's called backups, and VSS/Previous Versions. If needed, implement an actual document management system with versioning and auditing.
mfinni's user avatar
  • 36.2k
4 votes

Best way to find the computer a user last logged on from?

ThatGraemeGuy, thanks for excellent script! I had to rewrite it in PowerShell, but it still works. $CompDN = "(&(objectCategory=computer)(objectClass=computer)(cn=$env:COMPUTERNAME))" $strCompDN =...
Matvey Solodovnikov's user avatar
4 votes

What's the best way to see logged in users in Windows Server 2012?

Get-WMIObject -class Win32_ComputerSystem -ComputerName 192.168.1.9 | Select-Object UserName where 192.168.1.9 is the IP of the server
austin nwaka's user avatar
4 votes

How to change user to root in an SFTP client?

It's not completely true that you cannot change the user with SFTP. For example, even if you are connecting to the common OpenSSH server, you can instruct it to run the SFTP subsystem/server with ...
Martin Prikryl's user avatar
4 votes

How do I log every command executed by a user?

A lesser known trick, but easily the most awesome is just to use the built-in audit capabilities of sudo. Sudo ships with a sudoreplay command that makes replaying sessions easy. It will even relay ...
Erik Osterman's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible