I am generating FreeBSD 10 EC2 instances (https://aws.amazon.com/marketplace/...roduct_title?ie=UTF8&sr=0-2&qid=1453939360301) using the jclouds java library.
Instance comes with a username ec2-user and a keypair for login which you specify at creation time. You can su to root, passwordless.
To run commands on a newly created instance, jclouds connects to it via ssh, runs a bash script with sudo (to setup some stuff) and after that, whatever commands you specify. Problem: neither bash nor sudo are preinstalled on FreeBSD.
Because of that, I have to pkg install sudo and bash as root first. If I manually connect to the instance (
But if I try to run the same commands via jclouds ssh, I get "su: sorry" error. If I try to execute a simple command such as
Example output:
It seems to me that with jclouds ssh client I get thrown into some very restricted shell. Any ideas what is happening here?
Instance comes with a username ec2-user and a keypair for login which you specify at creation time. You can su to root, passwordless.
To run commands on a newly created instance, jclouds connects to it via ssh, runs a bash script with sudo (to setup some stuff) and after that, whatever commands you specify. Problem: neither bash nor sudo are preinstalled on FreeBSD.
Because of that, I have to pkg install sudo and bash as root first. If I manually connect to the instance (
ssh -i "privatekey.ppk" ec2-user@ip
) after it gets online I can run:
Code:
su root
pkg install -y sudo
pkg install -y bash
whoami
I get "not found". And if I try with /usr/bin/whoami I also get "not found".Example output:
Code:
/usr/bin/whoami: not found
su: Sorry
pkg: Insufficient privileges to install packages
pkg: Insufficient privileges to install packages