To troubleshoot this issue firstly check the heroku logs with command:
heroku logs -tail
Check for the error here,
Make sure you have logged into heroku with:
Check the list of apps in heroku with:
make sure you have initialized the git repository in the directory where your code is and not it’s parent or sub directory.
You can initialize it with git init
Add the files with git add .
Commit the files with git commit -m “Your message”
Add the remote git into heroku with:
heroku git:remote -a app-name
You can manually add the heroku git remote repository with the comand:
git remote add heroku email@example.com:arati.git
Check the remote with git remote -v
You can add ssh keys for heroku with command heroku keys:add
It will create ssh keys in .ssh folder of your home directory. Make sure you have ssh-keygen in your path otherwise you’ll be getting an error as: ‘ENOENT’: spawn ssh-keygen ENOENT
You should be able to push your code with: git push heroku master
Execute the following command:
ssh-keygen -y -f /tmp/key.pem > key.pub
You can use AllowUsers / AllowGroups if you have only a few users/groups that are allowed to login via ssh or DenyUsers / DenyGroups if you have only a few users/groups that are not allowed to login. Note that this only restricts login via ssh, other ways of login (console, ftp, …) are still possible. You need to add these options to your /etc/ssh/sshd_config file for most ssh installations.
If you have set the login shell to /bin/false you can use
su -s /bin/bash user (replace /bin/bashwith the shell of your choice)
Look at the shell specified in /etc/passwd for the jenkins user. You can do so by running something like:
grep jenkins /etc/passwd
The output will look similar to this:
The last field is the login shell of the user. Here you can see it is set to /bin/false which will immediately exit.
The solution is to specify which shell to use as you described:
su -s /bin/bash jenkins
Or modify the login shell of the jenkins user with “usermod(8)” (executed as a root user) :
usermod -s /bin/bash jenkins
grep jenkins /etc/passwd should now output something like:
su - jenkins will work as you expect.
You can do it without calling login shell:
sudo DUMMY=dummy su <username> -c 'echo "$DUMMY"'
Generate keys with the command:
ssh-keygen -t rsa
Then add the public key to the authorized_keys with the command:
cat .ssh/new_key.pub >> ~/.ssh/authorized_keys