How to limit bandwidth of
far better in terms of features and incremental copy mechanism. To limit bandwidth use
The general form:
An example of usage with 2MB limit per second transfer:
#linux #sysadmin #rsync #bandwidth
rsync
linux command?rsync
is an awesome tool in order to move files via ssh
into another server or from server to local system like what scp does butfar better in terms of features and incremental copy mechanism. To limit bandwidth use
bwlimit
like below:The general form:
rsync --bwlimit=<kb/second> <source> <dest>
An example of usage with 2MB limit per second transfer:
rsync --bwlimit=2000 /backup/folder user@example-host:/remote/backup/folder/
#linux #sysadmin #rsync #bandwidth
https://xiaoxiaoke.wordpress.com/2015/10/06/changing-java-security-restriction-for-network-connect-error-issue-in-kvm/
#linux #devops #sysadmin #kvm #hp
#linux #devops #sysadmin #kvm #hp
Ke Xu | Geek World
Changing java security restriction for “Network connect error” issue in KVM
I am using KVM to manage the servers in a rack. When launching the session jnlp files with javaws, I saw the “Network connect error” message. This is due to the default java security re…
How to SSH login without password?
You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
Now use ssh to create a directory
Finally append a's new public key to
From now on you can log into B as b from A as a without password:
#linux #sysadmin #ssh #password_less #ssh_login
You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from host A / user a to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
How to do it?
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory
~/.ssh
as user b on B. (The directory may already exist, which is fine):a@A:~> ssh b@B mkdir -p .ssh
b@B's password:
Finally append a's new public key to
b@B:.ssh/authorized_keys
and enter b's password one last time:a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B
#linux #sysadmin #ssh #password_less #ssh_login
Virt-builder
is a tool for quickly building new virtual machines. You can build a variety of VMs for local or cloud use, usually within a few minutes or less. Virt-builder
also has many ways to customize these VMs. Everything is run from the command line and nothing requires root privileges, so automation and scripting is simple.To see available virtual machines:
virt-builder --list
Sample command to create a
debian-9
image:sudo virt-builder debian-9 --size=50G --hostname prod.example.com --network --install network-manager --root-password password:YOUR_PASS
The above command creates a debian 9 image with disk size of 50GB and sets the hostname to
prod.example.com
. --network
enables the networking on guest and --install
installs packages on the target OS. The last parameter sets the root password to
YOUR_PASS
.To read more about the axtra parameters:
- http://libguestfs.org/virt-builder.1.html
#linux #sysadmin #virt_builder #debian #image
You can login to a server without entering a password by a simple command as below:
By issuing the above command it puts your public key content on server
#linux #sysadmin #ssh #passwordless_login #ssh_copy_id #authorized_keys #public_key
ssh-copy-id USERNAME@YOUR_HOST_IP -p 22
By issuing the above command it puts your public key content on server
~/.ssh/authorized_keys
and prompts you to enter the password. You are all done by this.#linux #sysadmin #ssh #passwordless_login #ssh_copy_id #authorized_keys #public_key
How I store & manage passwords in Linux for servers and other credentials? gopass
Password management should be simple and follow Unix philosophy. With
- https://github.com/gopasspw/gopass
#unix #linux #sysadmin #pass #gopass #password_management #golang #github
Password management should be simple and follow Unix philosophy. With
pass
, each secret lives inside of a gpg
encrypted file whose filename is the title of the website or resource that requires the secret. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities. gopass
is a rewrite of the pass
password manager in Go
with the aim of making it cross-platform and adding additional features. Our target audience are professional developers and sysadmins
(and especially teams of those) who are well versed with a command line interface. One explicit goal for this project is to make it more approachable to non-technical users. We go by the UNIX philosophy and try to do one thing and do it well, providing a stellar user experience and a sane, simple interface:- https://github.com/gopasspw/gopass
#unix #linux #sysadmin #pass #gopass #password_management #golang #github
GitHub
GitHub - gopasspw/gopass at opensourceprojects.dev
The slightly more awesome standard unix password manager for teams - GitHub - gopasspw/gopass at opensourceprojects.dev
https://stackoverflow.com/questions/13032409/ssh-remote-variable-assignment
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
#linux #sysadmin #ssh #local_variable #variable_expansion #bashrc #export
Stack Overflow
ssh remote variable assignment?
The following does not work for me:
ssh user@remote.server "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
ssh user@remote.server "k=5; echo $k;"
it just returns an empty line.
How can I assign a variable on a remote session (ssh)?
Note: My question is not about ...
How to copy a file in the same path with a different name?
Well you just need to use curly braces, {}, to make it happen:
What you usually MIGHT do:
You can take the smart path btw:
NOTE: if suffix of both files are different you can put that inside of curly braces too.
#linux #sysadmin #cp #copy #trick
Well you just need to use curly braces, {}, to make it happen:
What you usually MIGHT do:
cp /usr/local/share/lib/sample.conf /usr/local/share/lib/settings.conf
You can take the smart path btw:
cp /usr/local/share/lib/{sample,settings}.conf
NOTE: if suffix of both files are different you can put that inside of curly braces too.
#linux #sysadmin #cp #copy #trick