New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Proxmox 5.2 lxc templates ....
Hello People ,
i need some help from you guys ,
i have installed proxmox 5.2 version , i have downloaded the templates from the official site here
unfortunatly if i create a vm in proxmox any of this templates is not let me ssh :
ubuntu 16 -18
debian 8-9
Any advice ?
I am opened to pay for this , or give a nice vm for life.
I know is not something difficult but we are out of time so if anyone have past the same will be more rappid to put all online.
Thanks ,
Marius
Comments
Check sshd_config, if it's
#PermitRootLogin NoPassword
Change to
PermitRootlogin yes
Assuming you are deploying with root as the only user
They required SSH key instead of normal root access. Set the key and change the ssh config to yes and go!
I just created an Ubuntu 18 container from the official template today and I could SSH in no problem. Are the VMs NAT or have real IPs?
real ip
@cociu enter the .tar.gz file (in /var/lib/vz/template/cache/) using vim. Search and go to line of the sshd_config. Edit it, allowing password login. Save the file (in vim using :x) and you will be OK.
I would suggest to make a copy of the template and test it there, just to be sure, but, normally, this simple procedure will do your job. Vim editor will edit files directly inside a .tar.gz file without changing the rest of the archive.
P.S.: Have to notice that this works only with vim editor, not nano, pico etc.
The second solution is to create a new template using terminal and proxmox gui.
Create a new CT (e.g. 101) and enter it via terminal (pct enter 101). Change whatever you like to change there (preinstall stuff, allow ssh login, disable key login etc.).
Remove the files /etc/resolv.conf and /etc/hostname.
Do clean, autoclean, autoremove (apt-get clean ... etc.)
Exit and shut down the CT.
Go to proxmox GUI and remove all the network interfaces from the stopped CT.
Now, do a backup using gzip compression via Proxmox GUI (mode: stop, compression: GZIP good).
Your new template is ready. Move it from your dump folder to /var/lib/vz/template/cache and you can use it with your newly created configs.
Voila!
the problem is we have made this changes. The problem is came when the script is autoprovisioning the vm we need to wait 2 min until the ssh is active ... Any advice ?
This has not anything to do with the modified vm. It is likely more of the speed of the provisioning on your node. Or, maybe you have triggered any script that do some update, installation or anything else that needs the extra 2 minutes?
have in mind that proxmox need some time to extract the files from the .tar.gz template. Depending on the node and the HDD speed or I/O load, it maybe will need from 30 sec to one minute to do this.
The rest delay maybe is coming from an update trigger. Check the activity of the container entering via pct thru node immediately after you create and start it.
Is this LXC template? If yes, AFAIK you need to install and start openssh server first
All LXC templates do have by default installed openssh server (at least, the official ones). On the other hand, all current LXC templates do have ssh password login disabled by default
Proxmox 5.2-8 user here. Anytime I create a new container using the centos 7 downloaded template (20171212) I always have to install openssh-server to get SSH running.
for the moment we have get to work this templates :
centos 6, 7
ubuntu 14 , 16, 17 -----ubuntu 18 is not work
debian 8 , debian 9 is not work .....
any sugest ?
to mention we have installed openssh-server in all but in the templates what is not work we cannot ssh ....
@cociu You need to build one LXC CT with default template then create your own template using this LXC.
Install Open SSH Server
Modify /etc/ ssh /sshd_config
Change Config
PermitRootLogin without-password to PermitRootLogin yes
Restart SSH Service
Now Create your own template using this LXC CT
Shutdown the LXC
make a backup with vzdump an select tar.gz
move an rename the backupfile from ...../dump/x
Alternatively, log in to the Proxmox host with SSH and type:
pct enter container number
Where the container number is likely something like 101, 102, 103, etc. You can see it in your Proxmox control panel.
You'll then be SSH'ed into the container (without any login or password) as root.
Edit /etc/ ssh /sshd_config to set PermitRootLogin yes
It's just marvelous that you guys "answer" to a thread without even reading the original post and the replies!
@hostfav , we already wrote how to tweak a LXC template on the first replies. And he answered with additional infos for the specific issue.
As of you, @nductiv, what a nice advice you gave! Just, it is not much viable for a provider to enter manually to each newly created container to permit root login... BTW, before trying to help someone, be sure you really know what you suggesting.It's not "pve" but "pct" enter...
--sigh--
To clarify things, you tweaked the templates but when they are deployed, you still cannot automatically ssh onto them? Or you have the 2 minutes delay you wrote before?
The only known issue, as I recall, with proxmox 5.x is that in some cases, when provisioning a container thru the GUI, the password given there is not working and you have to pct to enter the container from the node to create/change the password manually.
Maybe this is the case? I am not sure if the same issue (IIRC not to all templates) applies not only when provisioning the CT thru GUI, but also when using proxmox API for automation.
So, can you tell us, on the non-working templates, what is the real issue?
Is SSH not working at all (no answer from the container)?
Is the container responding to the SSH but cannot login?
If the second is the case, then, enter the container thru pct from the node and give a password to root user. Then, try again to ssh the container from the internet. If you can login there, then, the issue is the wrong or not at all password the newly created container has when it is being provisioned.
Hmmm, not a centos freaqent user here! Most of a debian guy. In proxmox 4, openssh server is being installed automatically.
Now, I tested it and it really does not have openssh server installed by default. But, this is the minimal template. There is also another Centos 7 template, called "debian 7.0 standard 7.11-1 amd" that has the double size and does have openssh installed by default. But there, you need to tweak the template to allow password login, if you want this.