Skip to content

Instantly share code, notes, and snippets.

@xemuj
Last active October 7, 2022 23:25
Show Gist options
  • Save xemuj/0719ae4b5a2d17fa77c2fbe835b9d6ee to your computer and use it in GitHub Desktop.
Save xemuj/0719ae4b5a2d17fa77c2fbe835b9d6ee to your computer and use it in GitHub Desktop.
add ssh key to server

Add public ssh-key to server

echo -e 'put_the_key Key\n' >> ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys

put_the_key example

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA140tpuMIEVrPEz+ARDgno2KYcIsHUUaS6AWt0jN1XRmce8H+BnVM/eI0gRBbN+4UWxo8sq16VMN8/PGoPG6RINw+m3r560HPEls8cld/ZZlr3n6WEVJCGqVixrx+islXaqR3CuGJyR2TRRrGmkow6s/BaQAY1TPPlmhONEeoUhcJcT6l9iv1WezeXteX4YJzpYBUIpNdur+5SbuUHC2t0FLSkBganmhaW4ASl67cShXJKDIfptkrBG7h1ovhB0ywBRUUL/MjSqqMfOJqv4XXyuU65eXLWSDor7WsWjt1814Zs1kz0hGkF11FHdCAPsvzwvv1pVByr9fdJZneoapxqQ== Name_of_key

Add new user in existing group

$ adduser <newUser> www-data
$ id <newUserCreated>

$ chgrp www-data -R ./folder
$ chmod g+rwx -R ./folder

$ chown www-data:www-data -R ./folder
cd ~/.sftp-config/ && docker-compose down && docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment