2

Every time I power cycle the machine the .ssh folder permissions are reset and become too open for ssh.

I need to physically go to the machine and

chmod 0700 ~/.ssh

before I can ssh in (otherwise I get a permission denied (publickey) error) What would do that on boot up and how can I prevent it?

The machine is going to be deployed in a location that is not easily accessible to me, so I can't have it setup in a way that requires me to be there every time it is rebooted.

In case this is useful information. The machine is a fairly basic setup, Ubuntu Server 14.04 with nginx, php-fpm, mysql server, git, openssh. It has an SSD and 2 HDDs setup with RAID1.

Other than installing the OS & software, the only things I've done to the machine are: add a site to nginx, setup a database in mysql, and copy the public keys (from the 3 machines that will have access) into ~/.ssh/authorized_keys

The only none vanilla/standard things on there are: I mounted the RAID "drive" to /vol/ moved the mysql folder to /vol/mysql/ and cloned the webapp from github to /vol/www/

mike
  • 153

1 Answers1

0

You can make this command to execute every time you boot your system using the 'Startup Applications' that is available by default in ubuntu.

Just type 'Startup Applications' in the dash board. An application will open. Click Add button in the application and type the command (In your case, its chmod 0700 ~/.ssh) and u can also specify the Name and Comment for that command.

Now, every time you boot your system, this command gets executed automatically. You can also take a look on adding the startup programs on command line here

harirehm
  • 103