ssh debian@<ip-public>
ssh debian@web-<region>-sinp
puis ssh debian@db-<region>-sinp
vi /home/debian/.bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[1;33m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# Set PATH so it includes user's private bin if it exists and not already set if [[ -d "${HOME}bin" && ":$PATH:" != *":${HOME}bin:"* ]] ; then PATH="${HOME}bin:${PATH}" fi # Set PATH so it includes user's private bin if it exists and not already set if [[ -d "${HOME}.local/bin" && ":${PATH}:" != *":${HOME}.local/bin:"* ]] ; then PATH="${HOME}.local/bin:${PATH}" fi
ssh debian@<ip-public>
sudo -i
passwd
vi /root/.bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# Charger les alias depuis le fichier .bash_aliases if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
vi ~/.bash_aliases
alias nginx-reload='nginx -t && nginx -s reload'
alias pga='sudo -u postgres pg_activity -U postgres'
adduser geonat
usermod -aG sudo geonat
ssh-copy-id geonat@<server>
vi /etc/ssh/sshd_config
Match User geonat PasswordAuthentication yes
systemctl restart sshd
ssh-copy-id geonat@<ip-public-instance>
ssh geonat@<ip-public-instance>
su -
ssh geonat@<ip-public-instance>
su -
usermod -l admin -d /home/admin -m debian
groupmod -n admin debian
vi /etc/cloud/cloud.cfg
system_info:
> default_user:
> name: admin
chmod -R 740 /etc/sudoers.d/*
/etc/sudoers.d/
chmod -R 440 /etc/sudoers.d/*
systemctl reboot
ssh admin@<ip-public-instance>
sudo -i
visudo
@includedir /etc/sudoers.d
#includedir /etc/sudoers.d
/etc/sudoers.d
visudo -f /etc/sudoers.d/10-config-email
# Name of this file do not end in '~' or contain a '.' character. # This file should be mode 0440: `chmod 440 <this-file-name>` Defaults mailto = "adminsys@<domaine-sinp>" Defaults mailfrom = "mailer@<domaine-sinp>" Defaults mail_badpass Defaults mail_no_host Defaults mail_no_perms Defaults mail_no_user # Disable "always" because it sends too many messages with geonat user ! #Defaults always Defaults mailsub = "*** Command run via sudo on %h ***" Defaults badpass_message = "Please Provide Correct Password" Defaults !lecture,tty_tickets,!fqdn,!syslog Defaults logfile=/var/log/sudo.log
ls -al /etc/sudoers.d/
chmod 440 /etc/sudoers.d/10-config-email