You can change the priority of a process by changing how "nice" it is to other antagonising processes.
just type
renice <priority> -p <pid>
where priority is from 0 to 19
just type
renice <priority> -p <pid>
where priority is from 0 to 19
ssh
protocol. It consists of two basic components, an openssh-client
and an openssh-server
. SSH clients communicate with SSH servers over encrypted network connections.openssh-client
software should already be installed by default on Ubuntu. If you want to be able to accept SSH connections as well as request them, you’ll need the server software as well. The easiest way to ensure you have both is simply to run:sudo apt-get install openssh-client openssh-server
ssh
command:ssh remoteuser@remotebox
remoteuser
is the username of the remote account you’re trying to access, andremotebox
is the remote server’s hostname or IP address.openssh-server
) has a user account named joebanks
and that the IP address of that computer on your private LAN is192.168.0.12
, you could login remotely to that account from your Linux/Mac laptop by typing:ssh joebanks@192.168.0.12
ifconfig
on that machine. This will display the status of the active network interfaces, and the local IP address of that device will be listed after inet addr
. It will most likely be in the form of 192.168.0.xx
.cooldomain.com
, your syntax might look like:ssh joebanks@cooldomain.com
The authenticity of host 'remotebox (192.168.0.12)' can't be established.
RSA key fingerprint is 53:b4:ad:c8:51:17:99:4b:c9:08:ac:c1:b6:05:71:9b.
Are you sure you want to continue connecting (yes/no)?
yes
(the most common response), you’ll see the following:Warning: Permanently added 'remotebox' (RSA) to the list of known hosts.
remoteuser
‘s password:remoteuser@remotebox's password:
remoteuser@remotebox:~$
exit
, or use Ctrl-D
.scp
. To copy a single file from your local machine to the server, use the following syntax:scp file.txt remoteuser@remotebox:/directory
file.txt
is the name of a file in the current directory of your local machine,remoteuser@remotebox
is the username and hostname or IP address of the server (just like in the above ssh
examples, and /directory
is the directory path on the server where you want your file copied.file.txt
to the /home/joebanks/docs
directory on the server you logged into above, you’ll run the following command from a local terminal session:scp file.txt joebanks@192.168.0.12:/home/joebanks/docs
ssh
in to the remote computer and then run thescp
command. Secure copy opens the ssh
tunnel on its own. Since secure copy uses the ssh
protocol for a secure connection, whenever you run the scp
command, you’ll be prompted for a password (or passphrase) if the ssh
connection requires it.scp ~/docs/oldfile.txt joebanks@192.168.0.12:/home/joebanks/docs/newfile.txt
scp remoteuser@remotebox:file.txt /local/directory
remoteuser@remotebox
is the username and hostname or IP address of the server,file.txt
is a file in the /home/remoteuser directory, and /local/directory
is the local directory path into which the file will be copied.scp joebanks@192.168.0.12:~/docs/newfile.txt /home/joe/downloads
-r
switch, like so:scp -r /local/directory remoteuser@remotebox:/remote/directory
/local/directory
is the path to the local directory you want copied, and/remote/directory
is the remote directory into which you want the directory to be copied.scp -r remoteuser@remotebox:/remote/directory /local/directory
/remote/directory
is the path to the remote directory you want copied, and/local/directory
is the local directory into which you want the directory to be copied.joebanks@192.168.0.12
or whatever. It sure would be nice to type something shorter. Let’s fix that.~/.ssh/config
, to simplify some of the tedious typing associated with logging into remote machines. To edit (or create) that file, we’ll use the nano text editor, but you can use vi, emacs, kate or whatever:nano ~/.ssh/config
Host volcano HostName 192.168.0.12
volcano
with the HostName (or IP address) 192.168.0.12
, so now to login you’ll only need to type:ssh joebanks@volcano
Host BigWoo HostName 192.168.0.12 User joebanks
ssh BigWoo
scp
examples:scp file.txt BigWoo:
man ssh_config
.remoteuser
‘s password on each login attempt, SSH will initiate a challenge-and-response protocol which attempts to match an encrypted public key (stored on the server) with a protected private key (stored on the local machine). This completely eliminates the need to send sensitive information (like a password) over the network, encrypted or not.ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (~/.ssh/id_dsa):
Enter
. This selects the default location. Next you’ll see:Enter passphrase (empty for no passphrase):
Enter
at this point, thereby selecting no passphrase. This can be appropriate in some instances (see below), but you should be aware that it is not as secure. While ssh
will still use an encrypted public/private keypair (which is almost certainly more secure than typing the remote user’s password like you’ve been doing), anyone gaining access to your local account will thereby also gain unfettered access to any remote hosts which recognize your public key.Enter
, you’ll see:Enter same passphrase again:
Your identification has been saved in ~/.ssh/id_dsa.
Your public key has been saved in ~/.ssh/id_dsa.pub.
The key fingerprint is:
42:ac:8a:81:31:81:e5:7b:d2:01:42:2d:64:32:0f:dd localuser@localbox
~/.ssh/id_dsa.pub
to the remote machine, by running the following command from a local terminal session:ssh-copy-id -i ~/.ssh/id_dsa.pub remoteuser@remotebox
remoteuser
‘s password one last time, and then you’ll see the message:Now try logging into the machine, with "ssh 'remoteuser@remotebox'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
ssh-copy-id
method doesn’t work with your version of OpenSSH, try the following command:cat ~/.ssh/id_dsa.pub | ssh remoteuser@remotebox 'cat >> .ssh/authorized_keys'
~/.ssh
directory doesn’t yet exist on the remote machine, you can create the directory andcopy the public key all in one swell foop, like so:cat ~/.ssh/id_dsa.pub | ssh remoteuser@remotebox 'mkdir .ssh; cat >> .ssh/authorized_keys'
~/.ssh/authorized_keys
file on the remote machine contains your public key, you’ll be prompted for your passphrase at each login attempt, rather than the remoteuser
‘s system password, like so:Enter passphrase for key '~/.ssh/id_dsa':
~/.ssh
directory and the~/.ssh/id_dsa
file on your local machine, to disable any outside access to your private key.chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_dsa
ssh
and scp
in shell scripts and cron jobs to automate repetitive tasks, such as remote backups of critical files. To do so, however, you’ll need to implement some sort of passwordless authentication scheme, so that scripts can run without human intervention.ssh
command without requiring a password or passphrase, simply go through the steps outlined above for enabling public-key authentication, but instead of entering a passphrase when prompted, simply press Enter
.ssh-keygen
program will generate a public/private key pair for you that will allow password- and passphrase-less access to any remote server which has your public key stored in its authorized_keys
file.remoteuser
‘s password and sending it over the network. Sure it’s encrypted, but it could still be intercepted.ssh-agent
and keychain
daemons to store your passphrase between terminal sessions, so you don’t need to type it every time.Ubuntu swappiness. Improve ubuntu performance. vm.swappiness=10. sysctl.conf |
sudo /etc/init.d/network-manager restart
sudo dhclient -v eth1
#!/bin/bash
## Originally written by aysiu from the Ubuntu Forums
## This is GPL'ed code
## So improve it and re-release it
## Define portion to make Thunar the default if that appears to be the appropriate action
makethunardefault()
{
## I went with --no-install-recommends because
## I didn't want to bring in a whole lot of junk,
## and Jaunty installs recommended packages by default.
echo -e "\nMaking sure Thunar is installed\n"
sudo apt-get update && sudo apt-get install thunar --no-install-recommends
## Does it make sense to change to the directory?
## Or should all the individual commands just reference the full path?
echo -e "\nChanging to application launcher directory\n"
cd /usr/share/applications
echo -e "\nMaking backup directory\n"
## Does it make sense to create an entire backup directory?
## Should each file just be backed up in place?
sudo mkdir nonautilusplease
echo -e "\nModifying folder handler launcher\n"
sudo cp nautilus-folder-handler.desktop nonautilusplease/
## Here I'm using two separate sed commands
## Is there a way to string them together to have one
## sed command make two replacements in a single file?
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-folder-handler.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-folder-handler.desktop
echo -e "\nModifying browser launcher\n"
sudo cp nautilus-browser.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop --browser/thunar/g' nautilus-browser.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-browser.desktop
echo -e "\nModifying computer icon launcher\n"
sudo cp nautilus-computer.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-computer.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-computer.desktop
echo -e "\nModifying home icon launcher\n"
sudo cp nautilus-home.desktop nonautilusplease/
sudo sed -i -n 's/nautilus --no-desktop/thunar/g' nautilus-home.desktop
sudo sed -i -n 's/TryExec=nautilus/TryExec=thunar/g' nautilus-home.desktop
echo -e "\nModifying general Nautilus launcher\n"
sudo cp nautilus.desktop nonautilusplease/
sudo sed -i -n 's/Exec=nautilus/Exec=thunar/g' nautilus.desktop
## This last bit I'm not sure should be included
## See, the only thing that doesn't change to the
## new Thunar default is clicking the files on the desktop,
## because Nautilus is managing the desktop (so technically
## it's not launching a new process when you double-click
## an icon there).
## So this kills the desktop management of icons completely
## Making the desktop pretty useless... would it be better
## to keep Nautilus there instead of nothing? Or go so far
## as to have Xfce manage the desktop in Gnome?
echo -e "\nChanging base Nautilus launcher\n"
sudo dpkg-divert --divert /usr/bin/nautilus.old --rename /usr/bin/nautilus && sudo ln -s /usr/bin/thunar /usr/bin/nautilus
echo -e "\nRemoving Nautilus as desktop manager\n"
killall nautilus
echo -e "\nThunar is now the default file manager. To return Nautilus to the default, run this script again.\n"
}
restorenautilusdefault()
{
echo -e "\nChanging to application launcher directory\n"
cd /usr/share/applications
echo -e "\nRestoring backup files\n"
sudo cp nonautilusplease/nautilus-folder-handler.desktop .
sudo cp nonautilusplease/nautilus-browser.desktop .
sudo cp nonautilusplease/nautilus-computer.desktop .
sudo cp nonautilusplease/nautilus-home.desktop .
sudo cp nonautilusplease/nautilus.desktop .
echo -e "\nRemoving backup folder\n"
sudo rm -r nonautilusplease
echo -e "\nRestoring Nautilus launcher\n"
sudo rm /usr/bin/nautilus && sudo dpkg-divert --rename --remove /usr/bin/nautilus
echo -e "\nMaking Nautilus manage the desktop again\n"
nautilus --no-default-window &
## The only change that isn't undone is the installation of Thunar
## Should Thunar be removed? Or just kept in?
## Don't want to load the script with too many questions?
}
## Make sure that we exit if any commands do not complete successfully.
## Thanks to nanotube for this little snippet of code from the early
## versions of UbuntuZilla
set -o errexit
trap 'echo "Previous command did not complete successfully. Exiting."' ERR
## This is the main code
## Is it necessary to put an elseif in here? Or is
## redundant, since the directory pretty much
## either exists or it doesn't?
## Is there a better way to keep track of whether
## the script has been run before?
if [[ -e /usr/share/applications/nonautilusplease ]]; then
restorenautilusdefault
else
makethunardefault
fi;
chmod +x defaultthunar ./defaultthunar