How can i do login at sonattype nexus3 by line command - nexus

I have a VM with Nexus3 running on it.
I already config a yum-proxy repository.
In another VM I want to run yum update by nexus proxy.
If i put my username and password at my /etc/yum.repos.d/nexus.repo everything is going well.
But i don't like to keep my password in plain text.
Is there another way to login on nexus? something similar to yum login -u jhonatan.morais nexus.mydomain.com:8081

Related

How do I create a FTP user in Amazon Lightsail to update Wordpress Plugins

I successfully migrated a Wordpress site from BlueHost to AWS Lightsail. When I go to update the plugins, Wordpress is asking for FTP credentials (see the image).
By default, you can only connect to the Lightsail instance via SSH Certificate, which I have successfully done via Transit.
In your lightsail firewall rules make sure you allow access to TCP ports 21 and 1024-1048 from 127.0.0.1
SSH to your Lightsail instance (use putty for windows unless you know how to edit files with vim)
run the following commands to install vsftpd.
sudo apt install vsftpd
sudo nano /etc/vsftpd.conf
uncomment these lines:
local_enable=YES
write_enable=YES
add these lines:
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=127.0.0.1
Press Ctrl+X , Y , ENTER to save the changes to the file (this is why I said to use putty)
run this command to see what group owns the wp-content directory
ls -l /home/bitnami/apps/wordpress/htdocs/
In my lightsail instance, it was the "daemon" group
Note:other articles suggest adding this user to the bitnami group, but in my experience this resulted in errors during update siting that it was not able to create directories.
Run the following to create a new user and assign it to this group so that it will have access to write to the wp-content directory.
(in the following lines, substitute ftpuser for the new username)
sudo /etc/init.d/vsftpd restart
sudo adduser ftpuser
sudo usermod -d /home/bitnami ftpuser
sudo usermod -a -G daemon ftpuser
sudo /etc/init.d/vsftpd restart
Now you can try your updates again and it should work.
use 127.0.0.1 for the hostname and specify the new FTPuser credentials you just created.

Host key verification failed. in docker

I wanted to launch the jenkins which is installed through docker automatically in browser.. im working on windows os. in docker base os is ubuntu.. then i used solution from this link1.now im getting following error when i ssh using -v command i find that "read_passphrase: can't open /dev/tty: No such device or address"
by going through many websites i have created ssh file through windows using gitbash it contains id_rsa,id_rsa.pub,known_hosts files.
Now what should i do to launch the jenkins file in browser which is build using docker
I'm just going to address the error message you pasted for now.
ssh is trying to get keyboard input for the passphrase on your private key, but can't open the terminal correctly. Are you running the ssh command directly in the terminal, or from a script? If not, try running ssh directly. If you need to run ssh from a script:
Maybe try with keys that don't have a passphrase.
If you can use ssh-agent: Run eval $(ssh-agent), then run ssh-add and enter your passphrase. ssh will no longer prompt for a passphrase now.

Set password for RStudio Server with AWS EC2 instance

I managed to follow all the steps to create EC2 instance and install R Server on it.
When I go to RStudio Server page to connect (which looks something like "ec2-[Public IP]-.eu-west-3.compute.amazonaws.com:8787"), I am asked a username and a password.
I figured out to set a username ("user1") this way:
$ sudo useradd user1
But then when I try this command to write the password:
echo user1:password | chpasswd
I receive this message:
chpasswd: cannot lock /etc/passwd; try again later.
I looked at different solutions suggested here:
https://superuser.com/questions/296373/cannot-lock-etc-passwd-try-again-later
but I do not see a resolution to my problem.
I did not find either any passwd.lock, shadow.lock, group.lock, gshadow.lock files to remove.
type in 'sudo passwd your_username' and you will be prompted to enter a new password

FTP files up to Amazon AWS server

I have not been able to find an answer to this question, although there have been some similar questions. So I have a Amazon EC2 that I launched using a "Magento quick start" on the Amazon marketplace. Anyway so the site is working I can get to it via my domain and can also ssh in.
However when I login via filezilla I am using my key and also the username ubuntu . Now when I try to ftp something into my var/www/magento folder I get a permission denied. The default owner/group is nginx nginx
If I do a
sudo chown -R ubuntu:nginx var/www/magento
I am then able to ftp files up to the server. However when I go in the browser to the url the site then gives me an "this site can not be reached" error in chrome browser. However if I
sudo chown -R nginx:nginx var/www/magento
I am then able to see the site in the browser but am back to not being able to upload anything.
I also tried doing
sudo adduser ubuntu nginx
I got a success message but still not able to ftp. I get a permission denied error
So what is the ssh command(s) that would enable me to login to sftp with user ubuntu and be able to upload files and even change file permissions without making the site no longer load when you type in its domain name?
I believe I maybe just need to add the "ubuntu" user to the nginx group??
If so what would that command be?
thanks
try sudo usermod -a -G nginx ubuntu this will add your existing ubuntu user to nginx group. Also, log out from any existing session and login back.

Google Cloud: Compute VM Instances

How do I get root access to my Google VM instance, and also how can I log into my VM Instance from my PC with a SSH client such as putty?
I would also like to add that I have tried to do sudo for things that need root access to do those things, such as yum or wget. But it does not allow me to do sudo, it asks me for the root password but I do not know how, or where I would be able to get the root password.
You can become root via sudo su. No password is required.
How do I use sudo to execute commands as root?
(splitting this off from the other answer since there are multiple questions within this post)
Once you connect to your GCE VM using PuTTY or gcloud compute instances ssh or even clicking on the "SSH" button on the Developers Console next to the instance, you should be able to use the sudo command. Note that you shouldn't be using the su command to become root, just run:
sudo [command]
and it should not prompt you for a password.
If you want to get a root shell to run several commands as root and you want to avoid prefixing all commands with sudo, run:
sudo su -
If you're still having issues, please post a new question with the exact command you're running and the output that you see.
sudo su root <enter key>
No password required :)
if you want to connect your gce (google-cloud) server with putty using root, here is the flow:
use puttygen to generate two ppk files:
for your gce-default-user
for root
do the followings on putty (replace gce-default-user with your gce username):
Putty->session->Connection->data->Auto-login username: gce-default-user
Putty->session->Connection->SSH->Auth->Private-key for authentication: gce-default-user.ppk
Then connect to server using your gce-default-user
make the following changes in sshd_config
sudo su
nano /etc/ssh/sshd_config
PermitRootLogin yes
UsePAM no
Save+exit
service sshd restart
Putty->session->Connection->data->Auto-login username: root
Putty->session->Connection->SSH->Auth->Private-key for authentication: root-gce.ppk
Now ou can login to root via putty.
If you need to use eclipse remote system and log-in as root:
Eclipse->windows->preferences->General->network Connection->SSH2->private-keys:
root-gce.ppk
Please try sudo su - on GCE.
By default on GCE, there is no password required to sudo (do as a substitute user). The - argument to su (substitute user) further simulates a full login, taking the target user (the default user for both is root) configured login shell and its profile scripts to set new environment parameters. You'll at least notice the prompt change from ending in $ to # in any case.
JUST GOT TO CLOUD SHELL BY CLICKING SSH
AND FOLLOW PASSWORD CHANGE COMMAND FOR ROOT USER USING SUDO :)
sudo passwd
and it will change the root password :)
then to becom root use command
su
type your password and become a root :)
How do I connect to my GCE instance using PuTTY?
(splitting this off from the other answer since there are multiple questions within this post)
Take a look at setting up ssh keys in the GCE documentation which shows how to do it; here's the summary but read the doc for additional notes:
Generate your keys using ssh-keygen or PuTTYgen for Windows, if you haven't already.
Copy the contents of your public key. If you just generated this key, it can probably be found in a file named id_rsa.pub.
Log in to the Developers Console.
In the navigation, Compute->Compute Engine->Metadata.
Click the SSH Keys tab.
Click the Edit button.
In the empty input box at the bottom of the list, enter the corresponding public key, in the following format:
<protocol> <public-key> username#example.com
This makes your public key automatically available to all of your instances in that project. To add multiple keys, list each key on a new line.
Click Done to save your changes.
It can take several minutes before the key is inserted into the instance. Try connecting with ssh to your instance. If it is successful, your key has been propagated to the instance.

Resources