Category: Linux

Using SFTP to Move Files to or from a Remote Server

I have a couple of AWS instances running for class and regularly need to move files back and forth to the server from my local machine. I was initially using scp for this task, but navigating the file system on the remote machine was onerous and unwieldy. Enter SFTP….

SSH File Transfer Protocol is a secure way to move files between two machines using the SSH protocol to authenticate.

I already had a private key file set up to access my instance via SSH, and the connection command is very similar:

sftp -i name_of_your_keyfile.pem user@your_hostname

The -i parameter indicates that you are using a key file. Replace the generic placeholders with your information.

Once you are connected your prompt will change to sftp>.

Many of the available commands will be familiar, if you are used to navigating a Linux file system via a terminal:

CommandDescription
lsList contents of remote working directory
llsList the contents of the local working directory
pwd Displays the name of the local working directory
cd Changes the remote working directory
lcdChanges the local working directory
getCopies a file from the remote directory to the local directory
putCopies a file form the local directory to the remote directory
deletedeletes a file from the remote working directory

To get a complete list of commands you can type help or ?

Correcting High Volume Issue in Ubuntu

I use Ubuntu on a Lenovo ThinkPad as my primary development machine. I was experiencing an issue with volume control where the volume was consistently loud and lowering it would mute the sound. After poking at it a few times without success I finally was able to get it working as expected.

First you will need to edit a PulseAudio config file. Open a terminal and enter the following:

gedit /usr/share/pulseaudio/alsa-mixer/paths/analog-output.conf.common

Any text editor will work, I used gedit in the example because it is easy to use and installed by default.

You’ll be prompted for your user password to open the file as root.

Once it is open, you want to search the file for Element PCM. The text you are looking for looks like this:

[Element PCM]
switch = mute
volume = merge
override-map.1 = all 
override-map.2 = all-left,all-right

You need to modify the text so the volume setting is changed from “merge” to “ignore” and add a volume-limit value and set it to a specific number. You can play with the number setting to see what gives you the best results. I found that a setting of 0.0075 gave me more than enough maximum volume while still allowing me to lower the volume appropriately. Your updated text should look like this:

[Element PCM]
switch = mute
volume = ignore
volume-limit = 0.0075
override-map.1 = all 
override-map.2 = all-left,all-right

Once that has been updated, save the file and enter the following in a terminal to reset PulseAudio and apply the changes:

pulseaudio -k 

Test the new settings to see if your volume control is where you would like it to be. If it is not, you can go back and adjust the volume-limit setting up or down to suit your preferences. Just remember to reset PulseAudio each time to apply the changes you made.