How to Mount a Remote Folder using SSH on Ubuntu

Connecting to a server across the internet is much more secure using SSH. There is a way that you can mount a folder on a remove server using the SSHFS service.

There are quite a few steps that you’ll have to follow, so get ready and open a terminal window.

First we’ll install the module:

sudo apt-get install sshfs

Now we will use the modprobe command to load it

sudo modprobe fuse

We’ll need to set up some permissions in order to access the utilities. Replace <username> with your username.

sudo adduser <username> fuse

sudo chown root:fuse /dev/fuse

sudo chmod +x /dev/fusermount

Since we’ve added ourselves to a user group, we need to logout and back in at this point before we continue.

Now we’ll create a directory to mount the remote folder in. I chose to create it in my home directory and call it remoteserv.

mkdir ~/remoteserv

Now we have the command to actually mount it. You’ll be prompted to save the server key and for your remote password.

sshfs <username>@<ipaddress>:/remotepath ~/remoteserv

Now you should be able to cd into the directory and start using it as if it was local.

[email protected]:~/remoteserv$ ls -l
total 16
drwxr-xr-x 1 951247 155725 4096 2006-12-13 13:30 howtogeek.com
drwxr-sr-x 1 root root 4096 2006-09-11 06:45 logs
drwx—— 1 951247 155725 4096 2006-08-11 16:09 Maildir
drwxrwxr-x 1 951247 155725 4096 2006-10-29 02:34 scripts

时间: 2024-07-31 20:50:20

How to Mount a Remote Folder using SSH on Ubuntu的相关文章

How to mount a remote directory in Linux using sshfs

Q. I have access rights to one of the remote server through SSH protocol and there is no File share services such as Samba, NFS or FTP etc which are enabled on the server. Now I want to mount data from that remote server, is it possible to mount remo

【Linux基础】mount报错:mount.nfs: Remote I/O error

mount 报错:mount.nfs: Remote I/O error 挂载时需要指明版本,由于NFS服务器有多个版本,V2.V3.V4.而且各版本同时运行,因此挂载时需要说明版本号. 由于NFS V2最大只支持32BIT的文件大小(4g),而NFS V3则支持64BIT文件大小.另外V3对于V2还有其他优势,比如文件传输,异步写入等,因此建议采用V3进行访问. 解决办法:mount 加选项 -o nfsvers=3或者-o nfsvers=2       后面IP:/.../..   /..

windows 10使用vscode进行远程代码开发 | tutorial to use vscode for remote development using ssh on windows

本文首发于个人博客https://kezunlin.me/post/c93b6ba6/,欢迎阅读最新内容! tutorial to use vscode for remote development using ssh on windows Guide server sudo apt-get install openssh-server local install ssh-client on local machine. download VSCodeUserSetup-x64-1.36.1.e

Generating SSH Keys [Ubuntu Linux]

Generating SSH Keys We strongly recommend using an SSH connection when interacting with GitHub. SSH keys are a way to identify trusted computers, without involving passwords. The steps below will walk you through generating an SSH key and then adding

ssh登陆ubuntu开始较慢

Just add the parameter "UseDNS no" on /etc/ssh/sshd_config sudo service ssh restart 来自为知笔记(Wiz)ssh登陆ubuntu开始较慢

How to execute sudo command in remote host via SSH

Question: I have an interactive shell script, that at one place needs to ssh to another machine (Ubuntu based) and execute something as root (the user should enter his password, but the remote command should run like noted in the script): # ... ssh r

ssh连接ubuntu提示连接不上的问题

今天在自己的电脑上安装了最新版本的 ubuntu (我都在root用户下运行,非root用户请添加sudo命令) uname -rvo 运行结果为 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 GNU/Linux 在自己的windows系统上安装了ssh client,发现安装了后连接不上自己的ubuntu. 经过搜索,发现了自己的解决方法,现总结如下: 首先在 ubuntu上安装 ssh服务,运行如下命令 apt-g

ssh 连接ubuntu

一:用x-shell 连接ubuntu一直连不上,一下是解决方法. 二:具体的解决过程 1.网络 既然要远程ubuntu的系统.那么首先是两个网络是不是在一个网段.能不能ping的通? a)  Windows电脑上--cmd 打开命令窗口.键入:ipconfig 命令.查看主机IP. b)  ubuntu系统.ctrl + alt + F1打开命令终端.键入ifconfig 命令.查看ubuntu上网IP. c)  然后在ubuntu系统终端键入:ping +Windows上网的IP.查看是否p

SSh on Ubuntu

ssh程序分为有客户端程序openssh-client和服务端程序openssh-server.如果需要ssh登陆到别的电脑,需要安装openssh-client,该程序Ubuntu是默认安装的.而如果需要从远程连接到本机,则需要安装openssh-server,该程序需要自己安装.在Ubuntu下安装openssh-server非常简单. 安装openssh-server$ sudo apt-get install openssh-server 查看openssh-server是否启动$ ps