Skip to content

Commit

Permalink
move ssh_fix_permisisons to os/ubu
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlivio committed Dec 4, 2024
1 parent 1b6e209 commit be069af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 0 additions & 6 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ alias folder_count_files_recusive='find . -maxdepth 1 -type f | wc -l'
alias folder_list_sorted_by_size='du -ahd 1 | sort -h'
alias folder_find_file_with_crlf='find . -not -type d -exec file "{}" ";" | grep CRLF'
alias passwd_generate='echo $(tr -dc "A-Za-z0-9!?%=" < /dev/urandom | head -c 12)'
function ssh_fix_permisisons() {
# https://stackoverflow.com/questions/9270734/ssh-permissions-are-too-open
chmod 700 $HOME/.ssh/
chmod 600 $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa.pubssh-rsa
}

# -- load os/<name>.bash files --

Expand Down
7 changes: 7 additions & 0 deletions os/ubu.bash
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ alias linux_product_name='sudo dmidecode -s system-product-name'
alias linux_list_gpu="lspci -nn | grep -E 'VGA|Display'"
alias linux_initd_services_list='service --status-all'

function ssh_fix_permisisons() {
# https://stackoverflow.com/questions/9270734/ssh-permissions-are-too-open
chmod 700 $HOME/.ssh/
chmod 600 $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa.pubssh-rsa
}

function user_sudo_no_password() {
if ! test -d /etc/sudoers.d/; then sudo mkdir -p /etc/sudoers.d/; fi
SET_USER=$USER && sudo sh -c "echo $SET_USER 'ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/sudoers-user"
Expand Down

0 comments on commit be069af

Please sign in to comment.