Posts Tagged ‘ssh’
Here is a neat trick if you want to mount secured ftp mounted on your filesystem. SSH FTP, Secure FTP or SFTP, if I understand correctly, is FTP secured with SSH but is a little more complicated then I will go into right now. The bottom line is you can use SFTP like FTP but with the added encryption of SSH.
make sure sshfs, gvfs-fuse, and fuse are installed
via Debian as root:
aptitude install sshfs, gvfs-fuse, and fuse are installed
now add your desired user to the fuse group as root:
gpasswd -a username fuse
(if that is your current user log out and back in for change to take effect)
to mount make the desired directory, change the owner with the chown command, and use the sshfs command:
sudo mkdir /mnt/sftp
sudo chown username:fuse /mnt/sftp
sshfs username@example.com:/path/to/mount /mnt/sftp
now you can change directory via comandline or your file manager and make changes. Be sure to unmount properly for those changes to take effect.
fusermount -u /mnt/sftp
to set this up to be available on boot edit /etc/fstab
sshfs#usernames@example.com:/path/to/mount /mnt/sftp fuse rw,noauto,user,sync,noexec 0 0
NOTE: this will ask for a password each time, but you can set up ssh with a keyring to bypass the password. I currently do not have a tutorial on this, but you can do a search for “ssh passwordless” to learn how.
if you want it to mount automatically replace noauto with auto
(not advices, unless you are dealing with a computer on your local network)
if you have a regular ftp account you would like to mount thisway install curlftpfs instead of or in addition to sshfs.
to mount:
curlftpfs username:password@ftp.example.com /mnt/ftp
for availibilty upon boot your /etc/fstab should look something like this:
curlftpfs#usernames@example.com:/path/to/mount /mnt/ftp fuse rw,noauto,user,sync,noexec 0 0
This is handy if there is an ftp or sftp account you use regularly and you get tired of constantly login in via ssh or ftp.
NOTE: if you get the error “mount disagrees with fstab” try adding allow_other,uid=1000,gid=1000,fsname=sshfs#user@example.com:/path/to/mount to your fstab too look something like this (all one string):
sshfs#user@example.com:/path/to/mount /media/sftp fuse rw,noauto,user,sync,noexec,allow_other,uid=1000,gid=1000,fsname=sshfs#user@example.com:/path/to/mount 0 0
and uncomment allow_other in /etc/fuse.conf
ANOTHER NOTE:A handy gtk based gui for managing these kind of mounts is gigolo which require gvfs gvfs-backends gvs-fuse (in debian)
SSH allows you to remotely access your system through command line on Linux. When I was visiting family, one of the things I wanted to do with their home system was enable SSH access so that I could remotely login from my home computer 500 miles away to do any needed maintenance or troubleshooting. I had become exhausted by trying to troubleshoot Ubuntu over the telephone when they where having simple problems. The issue is that I speak techno babble, particularly the Linuxese dialect, and the speak the Microsoftish dialect of the layman. After I had them running with a basic desktop on Debian Lenny I did some research on SSH. The first thing to understand is the computer you wish to access with SSH is the host/server. The computer in which you are accessing the host/server is the Client. You first need to configure your host computer. The host needs to be running the SSH daemon.
sudo apt-get install openssh-server
you can edit the /etc/ssh/sshd_config file to indicate changes such as the port number to be used. This includes denying and granting access to specific users and groups. It is highly recommended to deny access to the user and group root:
DenyUsers root
DenyGroups root
if you wish to allow a specific user or group:
AllowUsers username
AllowGroups groupname
The user names and group names can be strung together and seperated by a space. Once finished save the file and exit. Restart the daemon
sudo /etc/init.d/ssh restart
Now your host server is completed and ready to be accessed from a remote computer. Use ifconfig to find your local network IP address, or alternatively you can use your that computer’s host. Generally Debian comes with the SSH client out of the box. You can double check to see if openssh-client is installed. To login to the host computer you use the ssh command and identify the user name and host:
ssh user@127.168.0.2
You will be prompted if you wish to continue connection (type yes) and then it will ask for the password for your user. Once succsessfully logined in you will be given a command line indicating the user and host name such as:
remote@fileserver:~$
Even though SSH sounds complicated, it is reletively easy to implement. There are varius configuration for tightened security one can try with SSH. One of the simplest security precautions is to change your port number in the /etc/ssh/sshd_config file. The SSH client will default to port 22. To specify a different port type:
ssh -p 188 remote@127.168.0.2
You are now ready to remote access your computer with SSH.




