Tag Info

Hot answers tagged

32

w


23

SU to the user su - username and run kill -9 -1 as the user. Exit the shell and try the userdel -r username again. Or you can check for processes from the user using lsof -u username and kill the relevant PIDs. Or pkill -u username or pkill -u uid


17

If you're doing it via T-SQL: Granting a Windows Login the ability to connect to SQL Server: CREATE LOGIN [Domain\User] FROM WINDOWS; or CREATE LOGIN [Domain\Group] FROM WINDOWS; If SQL Server-based login: CREATE LOGIN [LoginName] WITH PASSWORD = 'SomePassword'; After that, you can do one of two things. You can add it to the membership of the ...


15

Adding the - option affects your environment behavior. For all practical purposes, the environment is completely reset. In general, you likely want to use su - instead of plain su. From the man page: -l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. ...


12

Use the 'find' command if you have findutils version 4.3.0 or greater installed: For all files under the current directory that are writable by the current user: find . -writable For all files under the current directory that are not writable by the current user: find . ! -writable According to the man page: This test makes use of the access(2) ...


11

You could try using smem (see ELC2009: Visualizing memory usage with smem for more information). In particular, sudo smem -u should give you the information you want.


11

Use the who command. It lists everyone logged in, their terminal and their source hostname/ip address.


10

This tutorial has how to chroot ssh/sftp users. Essentially, you'll need to create a configuration section at the end of sshd_config like Match User username ChrootDirectory /home/somewhere AllowTCPForwarding no X11Forwarding no Add to that the PasswordAuthentication Yes (or ChallengeResponseAuthentication, whichever you're using) instruction ...


9

There are lots of ways of doing this (most of them insecure). Perhaps you aren't familiar with the fact that ssh can take an optional command (it logs in, runs the commands and logs out): ssh user@host who And if you set up a key you can do this with no password prompt.


9

This is how this works: When you login via FTP/SSH and upload files, they are created with your permissions. Probably your webroot is world writable (0777), that is insecure - every user in system can write something there. PHP runs with different user privileges (They are specified in PHP-FPM config, not nginx config), and as directory is world writable, ...


9

The profile path is the location of the user's user profile. The "Home" path may be the same, but it could be set to another location (via the user account properties). The home path is a bit of a vestigial thing. It dates back to Windows NT, prior to the 'My Documents' directory. I believe the original intent was to provide a "Home Directory" similiar to ...


8

You should set up key-based authentication for your users on the ssh server. Once you have key-based authentication configured, it's easy to set up the user's authorized_keys file to deny the user a tty using hte "no-pty" option for the key. Look at the man page for sshd and go to the AUTHORIZED_KEYS FILE FORMAT section for the available options: ...


8

When you are creating an account to run a daemon, service, or other system software, rather than an account for interactive use. Technically, it makes no difference, but in the real world it turns out there are long term benefits in keeping user and software accounts in separate parts of the numeric space. Mostly, it makes it easy to tell what the account ...


7

try: su myuser -s /bin/sh -c /home/myuser/script.sh


7

Ummm, seems Active Directory would be exactly what you need. Assuming you already own licenses for Windows Server, the cost will be a whopping $0. Update After hearing you describe your needs further, what you really need is a filesystem permissions auditing and management system, not really user and group management. It's quite unlikely that you'll find ...


7

use groupadd admin to add the group then you could run adduser myuser admin. However you may want to instead use usermod -G myuser,admin myuser to remove yourself from the root group. (instead of myuser,admin, list the exact list of groups your user should be a member of. If you ever get tempted to edit /etc/group directly, please use the vigr command, ...


7

sudo -u <username> <command> sudo accepts a user parameter, which will run it as that user. Alternatively, since you are root: su <username> -c <command>


7

I'll presume your question lies in finding inactive accounts. I use JoeWare's Oldcmp tool. http://www.joeware.net/freetools/tools/oldcmp/index.htm still after all these years. It can find inactive AD accounts by looking at password age and specifically LLTS = lastLogonTimestamp It's simple enough to at least get you started and easier than powershell. ...


7

Before that I think we need to be able to login to SQL Server first. I have experienced being a server administrator, but I couldn't login since SQL Server was installed by a Domain Admin account. So you might need to start SQL Server with command-line option -m (single user mode), sqlserver.exe -m and then do as K. Brian Kelley said. More ...


7

Depends what you mean 'full permissions'. If you want a user to have full read and write access to all files and directories in that directory, then this will help: chown -R username directory chmod -R u+rX directory The first command makes the user own the directory. The second command gives them full read and access permissions. The r gives read ...


7

Maybe it's proxies - proxies are configured in the environment, so might be different for different users, but be consistently set up for those users by their login scripts. I'd suggest env | grep proxy to find out what is set.


7

If the Linux machine has the finger daemon installed, you may be able to: finger @linux_machine However, finger is usually considered insecure these days and is not generally available by default.


6

The nobody user shouldn't need a shell but you could find that changing it may break something on Ubuntu. You can always give it a shot by changing it to nologin and see if anything breaks. There may be other system users that should not have a shell as well, see Your Distro is Insecure: Ubuntu. The main reason that nobody shouldn't have a shell is that a ...


6

You can use smbstatus to list out the processes: $ smbstatus -p Samba version 3.0.33-0.18.el4_8.1 PID Username Group Machine ------------------------------------------------------------------- 9672 george george gb (192.168.2.41) 14452 andrew andrew dev ...


6

su - invokes a login shell, which among other things, ensures that root's .bashrc and other shell startup scripts are run, just like as if you'd logged in directly as root via console or SSH. root's profile usually sets your path to include /sbin which is where ifconfig generally lives.


6

Not really sure if you can create a user which doesn't have a home directory specified. That being said, the specified home directory doesn't have to exists. You can call the adduser with the option --no-create-home. adduser --no-create-home foo (adduser is usually the preferred higher level tool if called interactively.)


6

I would personally invert your strategy and run the script as a non-privileged user, with sudo used to run the commands requiring root privileges. Is there any specific reason you need to run the script as root? To answer your question however, you can use the -c flag to run a specific command as a user: su someuser -c "touch /tmp/file" Reference: ...


6

Generally you want to chroot them into their home directory. If you do a google search on something like "linux chroot home directory" You will pull up hundreds of howto's on the subject. It's just not as easy as running a single command.


6

su aegir is what you're looking for, assuming the username is aegir. man su will give you more info on the su command. That user likely won't be able to actually restart Apache if it's running on port 80, unless specifically configured to be allowed to do so. By default, root is the only user that can bind a service to a low port number.


6

useradd doesn't create the user's home directory by default, nor does it ask for a password. You can pass the -m flag to create the home directory, and just run passwd after creation to set the password. man useradd will tell you more, obviously.



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