sudo su - admin
will let you become root
.
In AWS pfSense 21.05.2
, you login with the username admin
and automatically are root
after choosing option 8:
ssh -i ~/.ssh/your_key.pem admin@<your_ip>
*** Welcome to Netgate pfSense Plus 21.05.2-RELEASE (amd64) on pfsense ***
WAN (wan) -> ena0 -> v4/DHCP4: <your_ip>/<bits>
0) Logout (SSH only) 9) pfTop
1) Assign Interfaces 10) Filter Logs
2) Set interface(s) IP address 11) Restart webConfigurator
3) Reset webConfigurator password 12) PHP shell + Netgate pfSense Plus tools
4) Reset to factory defaults 13) Update from console
5) Reboot system 14) Disable Secure Shell (sshd)
6) Halt system 15) Restore recent configuration
7) Ping host 16) Restart PHP-FPM
8) Shell
Enter an option: 8
> whoami
root
> cat /usr/local/etc/sudoers
root ALL=(root) ALL
admin ALL=(root) ALL
%admins ALL=(root) ALL
ec2-user ALL=(root) NOPASSWD: ALL
You will see that /root/.ssh/authorized_keys
contains the same key as as /home/ec2-user/.ssh/authorized_keys
(the key you specified when you launched the instance).
If you try to login as root@<your_ip>
, you will get a Permission denied (publickey).
error.
The reason sudo su -
does not work by itself is that without a username specified, root
is implied, and you cannot login to root
directly (but must go through the admin
menu).