{"id":18400621,"url":"https://github.com/pcnate/server-setup","last_synced_at":"2025-04-12T16:57:54.347Z","repository":{"id":230465631,"uuid":"772377521","full_name":"pcnate/server-setup","owner":"pcnate","description":"Setup Linux servers with users, ssh keys and basic packages etc","archived":false,"fork":false,"pushed_at":"2024-04-06T21:48:04.000Z","size":51,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T03:24:20.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcnate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-15T04:22:48.000Z","updated_at":"2024-03-15T04:24:38.000Z","dependencies_parsed_at":"2024-11-06T03:04:06.071Z","dependency_job_id":"a21c0b08-e312-4641-ba08-63137f51a51d","html_url":"https://github.com/pcnate/server-setup","commit_stats":null,"previous_names":["pcnate/server-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcnate%2Fserver-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcnate%2Fserver-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcnate%2Fserver-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcnate%2Fserver-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcnate","download_url":"https://codeload.github.com/pcnate/server-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248601811,"owners_count":21131612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T02:35:11.735Z","updated_at":"2025-04-12T16:57:54.319Z","avatar_url":"https://github.com/pcnate.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# server-setup\nSetup Linux servers with users, ssh keys and basic packages etc\n\noriginially forked from https://github.com/jatt-software/server-setup when I used to work there.\n\nFor a physical machine, ensure BIOS is setup to power on the machine after a power outage and not require a keyboard\n\nBuild the server using the latest version of Debian Linux\nhttps://www.debian.org/distrib/netinst\n\nBe sure to select SSH server. No need to select Gnome desktop unless users will be logging into the machine. No need to be a print server. Anything else can be done after the setup and just makes the setup process take longer.\n\nSet root password and save it in ITGLUE\ncreate user account `setupuser` and use whatever password you want for setting it up\n\nAdd primary developer ssh public keys to the authorized_keys file\n```bash\nsu -\napt-get install -y sudo curl\nssh-keygen -f ~/.ssh/id_rsa -t rsa -b 8192 -N ''\nnano /root/.ssh/authorized_keys\n```\ncopy public keys into file\n\nSet a static ip if it is not already. you can do this later too if you are not onsite, you need internet access to continue\nhttps://linuxconfig.org/how-to-setup-a-static-ip-address-on-debian-linux\n\nBe sure to whitelist the server\n\nSetup the basic server with the following script\n```bash\ncurl https://raw.githubusercontent.com/pcnate/server-setup/master/server-setup.sh | sudo -E bash -\n```\nChange the passwords for your account. Default password is `Hunterway*`\n```bash\n#switch to that user\nsu - username\n\n# change the password\npasswd\n\n# then exit\nexit\n```\n\nLock the accounts that you did not change the password to with\n```bash\n# lock a user out\nsudo chage -E0 username\n```\n\nuse `exit` to logout and the log back in as yourself\n\ndelete the setup user\n```bash\nsudo deluser setupuser --remove-home --quiet\n```\n\n\n# External Hard Drives\n# NTFS ( harder )\nyou can access it from Windows \n```bash\nsudo apt-get install ntfs-3g exfat-fuse -y\n\n# show your disks\nsudo fdisk -l\n\n# get the UUID \nsudo blkid /dev/sdb1\n\n#backup fstab file, just in case\nsudo cp /etc/fstab /root/fstab\n\n# add the disk to /etc/fstab using the partitions UUID\nsudo sh - c 'echo UUID=\\\"4860F68460F677D0\\\" /media/fogbackup/ ntfs auto,hotplug,nofail,nls-utf8,umask-0222,uid-1000,gid-1000,rw 0 0 \u003e\u003e /etc/fstab'\n\n# verify contents and changed UUID if you haven't already\nsudo nano /etc/fstab\n\n# check disks, then test mount then check again\ndf -h\nsudo mount -a\ndf -h\n\n# if it shows up, powering it off, then wait a few secs, then back on to see if it disappears and shows up again\n# try rebooting with the drive turned off\n```\n\n# ext4 ( easy )\nrequires Mac or Linux to read the disk\n```bash\n# show your disks\nsudo fdisk -l\n\n#backup fstab file, just in case\nsudo cp /etc/fstab /root/fstab\n\n# make sure the disk is labeled\nsudo e2label /dev/sdb fogbackup\n\n# add the following line to /etc/fstab\nsudo sh - c 'echo LABEL=fogbackup         /media/fogbackup/   ext4    auto,nofail,defaults     0        2' \u003e\u003e /etc/fstab'\n\n# verify contents and changed UUID if you haven't already\nsudo nano /etc/fstab\n\n# check disks, then test mount then check again\ndf -h\nsudo mount -a\ndf -h\n\n# if it shows up, powering it off, then wait a few secs, then back on to see if it disappears and shows up again\n# try rebooting with the drive turned off\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcnate%2Fserver-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcnate%2Fserver-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcnate%2Fserver-setup/lists"}