Tag Info

New answers tagged

2

DO NOT SET THINGS in limits.conf !! In many new distro releases, especially enterprise distros, you'll find limits.conf is being phased out, and used now only monolithic lethergic leviathan companies like Oracle -- where the contractors who built the templates rolled into each new release's install scripts are now all long gone, and the time required to ...


2

/etc/security/limits.conf, at least on Debian. Path may vary a little by distro. There is an example in the file to limit all members of the student group to 4 logins (commented out): #<domain> <type> <item> <value> @student - maxlogins 4 You could do * instead of a group, but make sure not to hit ...


2

According to the man of limits.conf you can set restrictions in /etc/security/limits.conf: maxsyslogins maximum number of all logins on system So you can set (2 logins): * hard maxsyslogins 2 In another post is said not to use /etc/security/limits.conf. I could not find anything related to that except that value which is set in ...


1

The other answers are all good. This also works: pw usermod john -G mygroup


1

Wheel is famous for FreeBSD, if you want to need to use su command, you need to be member of wheel group, So pw groupadd get a groupName and -m get members of your group.Old style of the following command you needed to extra command. pw groupadd wheel -m mohsen,ali,john,Hilary,Kate


5

pw is the command you are looking for. To add user klaatu to the group foo, do: pw groupmod foo -m klaatu Here is the FreeBSD handbook page on the subject. It's an easy and informative read: Users and Basic Account Management


0

I assumed your problem is the su-pam file and the pam_rootok module. #%PAM-1.0 auth sufficient pam_rootok.so auth include system-auth The sufficient clause short-cuts the authentication process. So system-auth never gets included, which means the pam_group module is never activated for this session. Then, sigh I read ...


1

root@hostname # su - oracle could not open session root@hostname # grep oracle.*nofile /etc/security/limits.conf oracle - nofile unlimited set nofile in limits.conf to some number instead of unlimited: root@hostname # vi /etc/security/limits.conf root@hostname # grep oracle.*nofile /etc/security/limits.conf oracle - ...


2

Why do you want to see what was executed? If you are just curious, or trying to help a novice recover from a blunder or trying to share complex command lines, the other answers mostly work (with the caveat that each shell uses its own history file), but if you are auditing or something related to security or legal, you must realize that all shell history ...


1

Showing history of commands is very simple! Just type following command on terminal: history This will show you all commands you have used!


6

You can login as the user or simply su from root to the user and run the command history you can also search history quite easily history | grep "what ever" Finally you can use ctrl+r {whatever}


6

You can read ~/.bash_history file in users folder if you are admin or have special permissions.


0

This works for me: journalctl `which sshd` -a --no-pager --since="2015-02-04 00:00:00" | grep Failed Sample output: Apr 02 10:18:13 sturm sshd[6068]: Failed password for aboettger from 192.168.2.40 port 4812 ssh2 Apr 02 10:18:18 sturm sshd[6068]: Failed password for aboettger from 192.168.2.40 port 4812 ssh2 Or use the -p-Option, eg.: journalctl ...


0

I looked all over for this and never found a satisfying answer, but I managed to construct one, so... Note that this will update the file if it works, so if you're trying to not be noticed by the users whose keys you're testing, you may want to copy the key first. OTOH, since you just caught your user with a passwordless key, maybe you don't care if they ...


1

In addition to /etc/sudoers, sudo will also read files in the /etc/sudoers.d directory. The cloud-init application, commonly used on AWS instances, places a sudoers configuration in that directory for allowing the default user to sudo without a password.


0

Just Add the User into your local login User For Example: # useradd smbuser # smbpasswd -a smbuser Then only you can able to add the user as samba user


0

If you don't have access to the root account, but have the password of the user you want to use to run a command, you can do the following. This will ask you the toto's password : su - toto -c whoami This will not : ssh toto@localhost whoami Just install your public key in authorized_keys of toto Hope this can help ...


2

I had a similar problem when using rsync to backup my system to my server. I used: rsync -aAXSHPr \ -e ssh \ --rsync-path="sudo /usr/bin/rsync/" \ --numeric-ids \ --delete \ --progress \ --exclude-from="/path/to/file/that/lists/excluded/folders.txt" \ --include-from="/path/to/file/that/lists/included/folders.txt" \ / ...


0

go to Menu -> Administration -> Login Window Preferences -> Automatic Login Then uncheck any user that is set to auto login.


2

The Linux Kernel 2.6 and above supports unsigned 32-bit integers as UIDs and GIDs. This means the maximum UID should be 4294967294 (4294967295 is reserved) for RHEL4+ but it may depend on the system settings and utilities installed, specifically shadow-utils. You can test it out by trying a large UID, the only thing that would happen is it will reject it ...


2

All Unix systems have at least 16-bit user IDs, which can take values from 0 (reserved for root) to 65535 (reserved as an invalid value). Many modern flavors (including Linux) support larger values, but in a mixed network, you should avoid these unless you're sure that all operating systems, filesystems and network protocols support them (e.g. older versions ...


2

In Debian, the default groups are set up by base-passwd; the dialout group should always be present. If it isn't, you can use update-passwd to restore the expected configuration: sudo update-passwd (this will restore the system and user groups, but won't modify anything else). You simply need to add your user to the group: sudo adduser $(whoami) dialout ...


2

You can try the 'groupadd' command. user@system:~$ groupadd Usage: groupadd [options] GROUP Options: -f, --force exit successfully if the group already exists, and cancel -g if the GID is already used -g, --gid GID use GID for the new group -h, --help display this ...


3

65534 is some kind of default/nobody UID & GID value. Your VPS provider made some sort of mistake when they copied over your container. For example they used rsync but failed to use its --numeric-ids option. The user IDs inside your container don't exist outside the container and some copy tools, upon seeing UIDs and GIDs that they can't resolve, revert ...


0

I'm happy to do your homework for you, less competition in the job market: # cat /etc/passwd|awk -F\: '{ print $1 }'| sort | head -20


0

You can also count users with passwords in linux using /etc/shadow file: awk 'BEGIN { FS=":"; empty = 0; cnt = 0; } { if ($2 !~ "!" && $2 !~ "*") { if ($2 !~ "") emty++; else cnt++; } } END { print "passwords: " cnt "\nempty passwords: " empty }' /etc/shadow On FreeBSD I think you can use /etc/master.passwd


1

To find the number of lines in a file, simply use wc. To look at user accounts on a system, I recommend getent passwd, though there are many other equally valid ways of getting at this information. You can combine the two by passing the output of getent through wc: # getent passwd | wc -l to get a number representing the total number of user accounts ...


2

To get a list containing all group membership use id -a


9

The command that you must use for you is: id and for any other user: id username



Top 50 recent answers are included