Linux / Shell

Linux / Shell, and Solutions.

Permission denied

: command

://

Solutions:

  1. sudo : sudo <command>
  2. : chmod +x script.sh()
  3. : sudo chown $USER:$USER <file>
  4. : ls -la <file>

: Linux (rwx), chmod 777

command not found / command

: command

:command PATH

Solutions:

  1. command
  2. command: apt install <package> yum install <package>
  3. PATH: echo $PATH
  4. : /usr/local/bin/command
  5. :

: New PATH, ~/.bashrc

Address already in use / EADDRINUSE

:

:

Solutions:

  1. : lsof -i :8080 ss -tlnp | grep 8080
  2. : kill <PID> kill -9 <PID>
  3. : and more TIME_WAIT

:,

No space left on device

:

:

Solutions:

  1. : df -h
  2. : du -sh /* | sort -rh | head -10
  3. : sudo journalctl --vacuum-size=100M
  4. apt : sudo apt clean
  5. Docker: docker system prune -a

:, and

ssh: connect to host xxx port 22: Connection timed out

: SSH

:, SSH

Solutions:

  1. : ping <host>
  2. : telnet <host> 22 nc -zv <host> 22
  3. SSH : systemctl status sshd()
  4. : iptables -L ufw status
  5. / ACL 22

: SSH keepalive: ~/.ssh/config ServerAliveInterval 60