Can not add new user in docker container with mounted /etc/passwd and /etc/shadow

 

How to: Mount a SFTP Folder (SSH + FTP) on Ubuntu Linux using SSHFS & Fuse

Purpose: to mount a remote directory on my local Ubuntu Linux Desktop system using SFTP (which is SSH in an FTP-like fashion).

The goal is to easily gain access to a remote system’s files through another folder on my desktop. Debina/Ubuntu allows you to easily mount SSH folders via the GUI, however, these mounts won’t show up in the terminal (and in some programs).

sshfs to accomplish this.

 Ubuntu’s SSHFS documentation here.

Sshfs and mount

 

  1. add your username to the fuse group.
    1. On Ubuntu, you would open a terminal window and perform the following:

 

  • SFTP server. I created a folder on my desktop called sftp.
  • Once the folder has been created, simply run sshfs using the appropriate login information (host username and IP), the host and local directories, and the SFTP connection is mounted on a folder on my desktop.

Ref: creating a bash alias

 

possible errors and workarounds

 

Create a bash alias to save time and typing


  •  

unmount

bash comparison

Reference: http://www.tldp.org/LDP/abs/html/comparison-ops.html

 

 

 

#+ 
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_02.html

 

ntp client

# Server is ntpd

But client is $ntpdate

we need to install ntpdate

# – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Change  Server Time and Location

NTP server install on linux

I installed NTP server on Ubuntu Server 10.04 using:

The NTP daemon seems working and listening on the 123 port.

However, I was not able to get the time from another machine:

Remove  previous version

 


If you have ntpd installed on another machine, you can use your first server in the servers list of your ntp.conf file, or can synchronize one time with the -q option, as follows:

 

How to replace a string in shell script ?

 

Ways To Search For Files Using The Terminal

Today we will look at some of the common ways to search for files in Linux using the Terminal.

1) find : To search for files on the command line you can use the command “find”. The following is syntax for the “find” command:

find path criteria action

“path” – The section of the files system to search (the specific directories and all the sub directories). If nothing is specified the file system below the current directory is used.

“criteria” – The file properties.

“action” – Options that influence conditions or control the search as a whole, ie,
“–print”

 

 

2007-11-22-153941_1280x800_scrot

 

2) locate : The command “locate” is an alternative to the command “find -name”. The command find must search through the selected part of the file system, a process that can be quite slow. On the other hand, locate searches through a database previously created for this purpose (/var/lib/locatedb), making it much faster. The database is automatically created and updated daily. But change made after the update has been performed are not taken into account by locate, unless the database is updated manually using the command updatedb.

 

2007-11-22-154054_1280x800_scrot

 

3) whereis : The command “whereis” returns the binaries (option -b), manual pages (option -m), and the source code (option -s) of the specific command. If no options is used all the information is returned, if the information is available. This command is faster than “find” but is less thorough.

2007-11-22-154226_1280x800_scrot

 

4) which : The “which” command searches all paths listed in the variable PATH for the specific command and returns the full path of the command. the command is specifically useful if several version of a command exist in different directories and you want to know which version is executed when entered without specifying a path.

2007-11-22-154254_1280x800_scrot

 

5) type : The “type” command can be used to find out what kind of command is executed when command is entered – a shell built in command or an external command. The option -a delivers all instances of a command bearing this name in the file system.

2007-11-22-154354_1280x800_scrot