-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch User (su) not working #279
Comments
Please see the config from |
I was able to bypass the issue. |
- Add a new job named "testing05" in the ci.yml file - The job runs on ubuntu-latest - The job includes steps for checkout and login to GitHub Container Registry - The login step uses secrets for host, username, key, and port - The login step includes a script for executing a command #279 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Remove the line `name: login GitHub Container Registry` - Add the line `name: sudo command` - Remove the line `sudo su - -c whoami` - Add the line `sudo whoami` #279 Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Up on this matter, I have the same issue when I connect as a service account ( ======CMD======
echo "Switch user"
whoami
sudo su moutini
whoami
pwd
echo "Activate env"
conda activate ciara_venv And get this as output: ======END======
out: aboten
err: bash: line 10: conda: command not found
out: aboten
out: /home/aboten
2024/01/05 14:17:22 Process exited with status 127 I stay as the current user |
Solution founds: launch command as sudo and pipe your instructions on the fly sudo su - -c "whoami && echo 'hello world' && touch toto.txt Returns as planned: out: root
out: hello world |
@shubhenduanupamdutta Just add the following config to
|
Open your
update script - name: executing ubuntu instance using ssh
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{secrets.HOST_IP}}
username: ubuntu
key: ${{secrets.SSH_KEY}}
port: 22
request_pty: true
script: |
sudo whoami see the example: ssh-action/.github/workflows/ci.yml Lines 274 to 284 in 9b978f0
|
I have already tried going into root mode before. But it is still not working.
The text was updated successfully, but these errors were encountered: