Posts

Showing posts from May, 2017

special access permissions suid sgid sticky

SUID : if setuid bit is set, when the file is executed by user, the process will have the same rights as the owner of the file being executed SGID : same as above, but inherits group privileges of the file on execution, not user privileges. Similar way when you create a file within directory, it will inherit the group ownership of the directories. Sticky bit: Sticky bit was used on executables in linux so that they would remain in the memory more time after the initial execution, hoping they would be needed in the near future. But mainly it is on folders, to imply that file or folder created inside a sticky bit enabled folder could only be deleted by the owner. /tmp folder as example ------------------------------------------ set user id files - Run executable files as owner set group id files - run executable files as group owner directory - new files are owned by group owner sticky bit - directories - Delete files only if owner of file or owner of the parent directory

sudo service network-manager restart | nmcli con show | nmcli d

sudo service network-manager restart nmcli con show nmcli con up ens33

Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?

Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock

ldap ubuntu centos LDAP authenticatoin

Image
lightway directory access protocol LDAP  (Lightweight Directory Access Protocol) is a software protocol for enabling anyone to locate organizations, individuals, and other resources such as files and devices in a network, whether on the public Internet or on a corporate intranet. ldap provides an easy way for centralized authentication server. ldap allows to connect to directory server. LDAP connects to directory server , directory server is hierarchical in its setup ( like DNS) lisa.certification.com - dns way of writing dc - container, not a live object cn - common name, live object ldap notation: cn=lisa,dc=certification,dc=com when setting up connection to LDAP server we use base context . Base context is like search domain in DNS, it's starting point where your clients start looking for objects, like user objects base context example : dc=certification,dc=com login binary is used to connect to everything [root@localhost ~]# which login /bin/login

centos openldap [draft]

[root@localhost slapd.d]# cat db.ldif dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcSuffix olcSuffix: dc=ex,dc=com dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcRootDN olcRootDN: cn=ldapadm,dc=com dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcRootPW olcRootPW: {SSHA}aKjC9y0eg2CGm3j [root@localhost slapd.d]# ldapmodify -Y EXTERNAL  -H ldapi:/// -f db.ldif SASL/EXTERNAL authentication started SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth SASL SSF: 0 modifying entry "olcDatabase={2}hdb,cn=config" modifying entry "olcDatabase={2}hdb,cn=config" modifying entry "olcDatabase={2}hdb,cn=config" [root@localhost slapd.d]# cat db.ldif dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcSuffix olcSuffix: dc=ex,dc=com dn: olcDatabase={2}hdb,cn=config changetype: modify replace: olcRootDN olcRootDN: cn=ldapadm,dc=com dn: olcDatabase={2}hd

authconfig NIS LDAP

authconfig provides a simple method of configuring /etc/sysconfig/net- work to handle NIS, as well as /etc/passwd and /etc/shadow, the files used for shadow password support. Basic LDAP, Kerberos 5, and SMB (authentication) client configuration is also provided.

show dns default route release/renew IP nmcli dhclient -r resolv.conf

default route  route -n DNS cat /etc/resolv.conf How can I renew or release an IP in Linux for eth0? To renew or release an IP address for the eth0 interface, enter: $ sudo dhclient -r eth0 $ sudo dhclient eth0 In this example, I am renewing an IP address for my wireless interface: sudo dhclient -v -r eth0 sudo dhclient -v eth0 nmcli command (NetworkManager) to renew IP address in Linux The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices command-line tool for controlling NetworkManager. The  nmcli  is a command-line tool for controlling NetworkManager and getting its status. To renew IP address using nmcli for connection named ‘nixcraft_5G’ (use ‘ nmcli con ‘ command to get list of all connections): nmcli con nmcli con down id 'nixcraft_5G' nmcli con up id 

ubuntu openldap | getent passwd ldapsearch -x

Image
OpenLDAP admin guide at  http://www.openldap.org/doc/admin24/intro.html . slapd (8) is an LDAP directory server that runs on many different platforms Let's start with installing the LDAP package and helper utilities: Update your repository using the  apt-get update  command and then install the OpenLDAP package,  slapd : $ sudo apt-get update $ sudo apt-get install slapd ldap-utils You will be asked to enter the admin password and to confirm it. The installation process simply installs the package without any configuration. We need to start the actual configuration process with the reconfiguration of the  slapd  package. Use the following command to start the re-configuration process: $ sudo dpkg-reconfigure slapd This command will ask you a series of questions including the domain name, admin account, password, database type, and others. Match your answers as follows: Omit LDAP server configuration –  NO . DNS Domain name – Enter your domain name. You can