问题
In my staging.rb file i need to connect with "ubuntu" username
server '**.**.****.**', user: 'ubuntu', roles: %w{web app db}
In my deploy.rb
set :deploy_to, -> { "/var/www/myuser/myuser.com/capi" }
Server
var/www/myuser/myuser.com# ls -la
total 32
drwxrwx--- 8 myuser myuser 4096 Jul 9 14:54 .
drwxrwx--- 5 myuser myuser 4096 Feb 26 17:18 ..
drwxrwx--- 7 myuser myuser 4096 May 7 13:48 beta
drwxr-xr-x 2 myuser myuser 4096 Jul 9 14:54 capi
drwxrwx--- 9 myuser myuser 4096 May 8 20:15 quiz
drwxrwx--- 2 myuser myuser 4096 May 8 20:10 scoreboards
drwxrwx--- 2 myuser myuser 4096 May 8 20:10 stats
drwxrwx--- 7 myuser myuser 4096 Jul 2 14:58 www
when i do "bundle exec cap staging deploy" i have this error
mkdir stderr: mkdir: cannot create directory '/var/www/myuser': Permission denied
mkdir: cannot create directory '/var/www/myuser': Permission denied
How i can change user with capistrano?
来源:https://stackoverflow.com/questions/31321315/capistrano-change-user-after-ssh-log-in-deploy-as-another-user