Monthly Archives: April 2017

File permission and ownership commands

Basics: u=user (owner), g=group, o=others (world), a=all r=read(4); w=write(2); x=execute(1) 1=x, 2=w, 4=r, 5=rx; 6=rw; 7=rwx  chmod: chmod 755 file             (User-> rwx; Group-> rx; Others-> rx) chmod -R 755 dir        (Apply permission recursively) chmod uo+x,g-w file   … Continue reading

Posted in LFCS, Linux

User and group commands in Linux

User commands: useradd  (-d: directory; -s: shell; -G: group list; -c: comments)   useradd -m user    (-m: create user home directory) useradd myuser -d /home/myuser -s /bin/csh -G grp1,grp2 -c “My User” userdel -r user             (Remove user and … Continue reading

Posted in LFCS, Linux | Tagged

Ubuntu Advanced Packaging Tool commands

1. apt-get: apt-get update (updates only the list of available packages and their versions, but will not perform any update) apt-get upgrade (this will actually updates already installed packages, must run update before upgrade) apt-get upgrade apache2 apt-get dist-upgrade (More … Continue reading

Posted in Linux, Other | Tagged

RPM commands

Install, Upgrade and Remove a package: rpm -ivh httpd-2.4.6-45.el7.centos.4.x86_64    (Install a package) rpm -Uvh httpd-2.4.6-45.el7.centos.4.x86_64   (Upgrade a package) rpm -e httpd                                       … Continue reading

Posted in LFCS, Linux | Tagged ,

Yum commands

1. Check and update all the packages: yum check-update yum list updates yum update   (Update but preserve obsolete packages, safer option) yum upgrade (Update plus forcefully remove obsolete packages) 2. Install or update, list and get details of a package: … Continue reading

Posted in LFCS, Linux | Tagged ,

Script to check connectivity between single or multiple hosts – telnet

Alternate to telnet commands to check single host: echo > /dev/tcp/{host}/{port} && echo “SUCCESS” || echo “FAILED” timeout 1 bash -c ‘(If output 0 then Sucess else Failed) Script to check connectivity between multiple hosts: #!/bin/bash SRC_HOSTS=(‘src1’ ‘src2’ ‘src3’ ‘src3’ … Continue reading

Posted in Linux | Tagged

No supported authentication methods available (Server sent: publickey)

First of all make sure you have setup ssh keys correctly by following the post: https://websphereissues.wordpress.com/2014/11/25/add-ssh-keys-for-a-user-in-linux/ In /var/log/secure, if you noticed the error “Authentication refused bad ownership or modes for directory“, then you need to set “StrictModes no” in /etc/ssh/sshd_config file and … Continue reading

Posted in Other