Skip to content

sexym0nk3y/raspberry-tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Raspberry Tips & Tricks & Hacks

General

Change root password : sudo passwd root

Enable SSH before first boot

Recent Raspbian disabled SSH by default.

If you want to enable SSH, all you need to do is to put a file called ssh in the /boot/ directory.

Default user / password : pi / raspberry

Install & Enabling VNC

Install VNC with

sudo apt update
sudo apt install realvnc-vnc-server

You can enable VNC Server with

sudo raspi-config

Navigate to Interface Options and select VNC > Yes

Troubleshooting

Cannot Currently Show the Desktop

Launch sudo raspi-config

Select Interface Options > Resolution and select a lower resolution. And reboot.

Mount a CIFS Share Folder

Execute sudo mkdir /mnt/<LOCALDIRECTORY>: Change <LOCALDIRECTORY > with your folder name.

Execute sudo nano /etc/fstab and add :

//<IPADRRESS>/<DIRECTORY> /mnt/<LOCALDIRECTORY> cifs user=<USERNAME>,pass=<PASSWORD>,uid=<UID>,x-systemd.automount 0 0

Get user uid: id -u <username> Default: pi username.

Mount folder sudo mount -a

Backup: SD Card Image command line

Gzip backup command line. Backup time may take time. About 1 hour for a 32GB card

sudo dd bs=4M if=/dev/<DEVICEID> | gzip > /<LOCALORMOUNTFOLDER>/<BACKUPNAME>.img.gz

Default SD CARD DEVICE ID : mmcblk0

Send an email notification when someone logs in through SSH

/!\ Require sendmail.

  1. Create a new folder in /usr
    sudo mkdir /usr/custom
    
  2. Create a new script sudo touch /usr/custom/ssh_alert.sh
  3. Change permissions
    sudo chmod 0700 /usr/custom/ssh_alert.sh && chown root:root /usr/custom/ssh_alert.sh
    
  4. Use your favorite editor to edit the file and copy and paste this file ssh_alert.sh
  5. Final step - add this line at the end of /etc/pam.d/sshd
    session required pam_exec.so /usr/custom/ssh_alert.sh
    

Releases

No releases published

Packages

No packages published

Languages