Skip to content
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

How to set password #1

Open
turkishman41 opened this issue Dec 27, 2023 · 1 comment
Open

How to set password #1

turkishman41 opened this issue Dec 27, 2023 · 1 comment

Comments

@turkishman41
Copy link

I run all command but server saying password is wrong

@hswong3i
Copy link
Member

If you are running with bash:

$ sudo -E podman run -ti --rm --name centos alvistack/centos-9-stream bash
+ '[' b = - ']'
++ id -u
+ '[' 0 = 0 ']'
++ hostname -s
+ _HOSTNAME=2d3cb94d148b
+ sed -i s/localhost/2d3cb94d148b/g /etc/ansible/hosts
+ '[' bash = /usr/sbin/sshd ']'
+ exec bash
[root@2d3cb94d148b ~]# whoami
root

If you are running with default entrypoint with ssh, sorry that we didn't have default username/password setup, neither root or vagrant:

$ sudo -E podman run -ti --rm --name centos -p 2222:22 alvistack/centos-9-stream
+ '[' / = - ']'
++ id -u
+ '[' 0 = 0 ']'
++ hostname -s
+ _HOSTNAME=9c29b66a8023
+ sed -i s/localhost/9c29b66a8023/g /etc/ansible/hosts
+ '[' /usr/sbin/sshd = /usr/sbin/sshd ']'
+ ansible-playbook /etc/ansible/playbooks/verify.yml

PLAY [verify | all] **************************************************************************

TASK [Gathering Facts] ***********************************************************************
ok: [9c29b66a8023]

TASK [include default variables] *************************************************************
ok: [9c29b66a8023]

TASK [include release specific variables] ****************************************************
ok: [9c29b66a8023] => (item=/etc/ansible/playbooks/./vars/centos-9.yml)

TASK [ssh-keygen] ****************************************************************************
ok: [9c29b66a8023]

TASK [prepare directories] *******************************************************************
changed: [9c29b66a8023] => (item={'dest': '/root', 'mode': '0700'})
ok: [9c29b66a8023] => (item={'dest': '/root/.ssh', 'mode': '0700'})
changed: [9c29b66a8023] => (item={'dest': '/run/sshd'})

TASK [touch files] ***************************************************************************
changed: [9c29b66a8023] => (item={'dest': '/root/.ssh/authorized_keys', 'mode': '0600'})

PLAY RECAP ***********************************************************************************
9c29b66a8023               : ok=6    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

+ exec /usr/sbin/sshd -eD
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
Failed password for root from 10.88.0.1 port 39838 ssh2
Connection closed by authenticating user root 10.88.0.1 port 39838 [preauth]
Invalid user vagrant from 10.88.0.1 port 40116
Failed password for invalid user vagrant from 10.88.0.1 port 40116 ssh2
Connection closed by invalid user vagrant 10.88.0.1 port 40116 [preauth]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants